Trade Tracker Code In Google Sheets | Master Portfolio Tracker

Поделиться
HTML-код
  • Опубликовано: 4 мар 2021
  • Trade Tracker Code In Google Sheets | Master Portfolio Tracker
    📈 Link to download all my Portfolio Trackers: / thinkstocks
    ☑️ Follow me on Twitter: / keithfrislid
    🌎 Check out my discord server: / discord
    🎥 Here is the camera I use for my videos: amzn.to/2PB865Q
    🔶Get 50% off Seeking Alpha Premium with my Promo Link!!!🔶
    www.sahg6dtr.com/28KL61/R74QP/
    In this video, I will show you how to track every trade you make in Google Sheets so you can create these amazing portfolio trackers. This tutorial will show you how to write your own function to calculate exactly how many stocks you have, how many shares of each stock, and what your average purchase price is! This code is a major update from one of my older portfolio tracker videos. In that video, the code did not account for when you sold off a stock then rebought it at a later date. This would mess up the purchase price.
    This video will show you how to fix that problem and how to write a code in google sheets that will no longer count stocks that have been sold off already using the FIFO method or "first in first out".
    Link to Portfolio Tracker Video: • Build Your Own Stock P...
    If you want to support my channel check out both my Patreon and discord below!
    AFFILIATE DISCLOSURE: Some of the links on this channel and in video descriptions are affiliate links. At no additional cost to you, we receive a commission if a purchase is made after clicking the link.
    #googlesheets #codeingooglesheets #stocksingooglesheets

Комментарии • 341

  • @austin3515
    @austin3515 2 года назад +2

    Nice one mate! I had to go over the whole code a second time cause I was one number off but Its worth it! Awesome work man, your very detailed and clear with your walkthroughs

  • @prettykolosa5801
    @prettykolosa5801 3 года назад +1

    @Think Stocks You are an amazing human being. Thank you for great content and for your help. I really do appreciate you. I wish I could give this more than one like.

  • @birdie12888
    @birdie12888 3 года назад +8

    Notice the copy and paste around 51' of the video, the sell shares do not have the "minus" sign like the previous Build Your Own Portfolio video. So if you copy and paste from that worksheet, then you have to take out the minus quantity sign from all the Sell Quantity in order for this to work.

  • @argoskier
    @argoskier 3 года назад +1

    Dude, how are you so nice!?! Thank you so much. After finding all my spelling mistakes I finally got it working. What a great code, THANK YOU :)

  • @mashiqkhan47
    @mashiqkhan47 3 года назад +1

    I created my own Stock Portfolio on google sheet using your three Video lessons: 1-Build Your Own Stock Portfolio Tracker, 2-Code to Track Every Trade and 3-Automated Email Stock Price Alerts. It’s working flawlessly, amazing! Thank you for your good teacher like guidance.💐

  • @jordanhicken1999
    @jordanhicken1999 3 года назад

    Yes 🙌. These sheets back videos are 🔥

  • @9760110
    @9760110 3 года назад +2

    Very helpful update indeed. Looking forward to more advanced ad-on features. Cheers!

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      And they are coming! Got some cool add on features that will drop soon

  • @edwinalansilvatorres544
    @edwinalansilvatorres544 3 года назад

    Great job! it works perfect

  • @abdullahalismail5046
    @abdullahalismail5046 3 года назад +2

    Thank you ! Really Thank you

  • @07rahul87
    @07rahul87 3 года назад

    Thanks for your effort, May be you won't get so much like the way entertainment video are getting. But we really appreciate your effort for making such video which will help us teach us about our financial. Thank you very much.

  • @narysis
    @narysis 3 года назад +1

    Thanks for the update, this is great! and love the walk through. Question: do you have a code/script to determine the date (mm/20XX) your dividend return will outpace the rate at which you're able to invest principle? I'm trying to add some forecast dates when I'll reach certain portfolio goals.

  • @jonathanmai5819
    @jonathanmai5819 3 года назад +2

    Thank you for your hardwork!!
    Is it possible to make a track list for options volume and open interest??

  • @MrThiruChandru
    @MrThiruChandru 3 года назад

    Greetings From India.
    It works fine for me. Thanks for this update.

  • @1kaidoloor
    @1kaidoloor 3 года назад +2

    Great stuff. Thanks. If you are considering new features please also consider having multiple portfolios/strategies and showing results for each portfolio/strategy. As we know, one should use ~5 strategies, not one strategey. I will try this myself, but if you deem this relevant to you or your audience, it might make sense to include this feature.

  • @HawkIjr
    @HawkIjr 3 года назад

    Fun coding with you... I linked this to me exportable transaction from my account and it works quite well. The only bug I ran into is short sells... it seems when the sell comes in first, the math is missing on the buy side... I played around with the code and righted the ship! Thanks again for sharing...

    • @Wolfgaming1
      @Wolfgaming1 3 года назад

      how did you fix this? I wanna make a portfolio tracker that has everything included, international, crypto, dividend and short selling. This video and a couple of others cover everything but the short selling according to you. Thanks

  • @kev1nme1er
    @kev1nme1er 3 года назад +8

    Great stuff. This should also deal with multiple accounts, which is something I modified the old source to handle. I will modify this code as well but just wanted to throw it out there that many people have multiple trading accounts and want to track the performance of each account individually. In Canada, we can trade within a TFSA, RRSP and Margin account.

    • @robertcarroll5498
      @robertcarroll5498 3 года назад

      Agreed, my wife and I have several accounts that I manage. It would be great to see the breakdown of each one.

    • @nsearchoftruth8655
      @nsearchoftruth8655 2 года назад

      So are you all creating a different tracking portfolio for each exchange you use? For instance, I have bitcoin on several exchanges.

  • @JasonEala
    @JasonEala 3 года назад

    Great and thanks. Now time to find out how to incorporate shorting stocks and using margin formulas... searching the internet for answers.. lol

  • @herbertkunze3610
    @herbertkunze3610 3 года назад

    Thank you for this great input! - How would you link screenshots for easy access? Greetings to you from germany 😀

  • @ranonl8841
    @ranonl8841 3 года назад +1

    This tutorial was superb. Noticed the cost avg discrepancies when experimenting with GME Buy/Sells a couple weeks ago. Good to see you've worked on a fix.
    However... because i've heavily modded my sheet to best suit GBP and GBX (pence), i'm now completely out of my depth when it comes to applying your script amendments.
    Will be on the lookout for more of your work!

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Oh don't worry I found a work around for GBX in Google sheets. Ill be coming out with something soon for that!

    • @ranonl8841
      @ranonl8841 3 года назад +1

      ​@@ThinkStocks I figured out where the issue was... which was to remove the negative sign when clocking in sell quantities. So now the new script works perfectly!

  • @mattweisbart4061
    @mattweisbart4061 3 года назад

    Thank you for taking the time to post this excellent tutorial! My only problem is that I have wash sales, so the cost basis using these formulas for one of my stocks is completely different than what I see in my trade account. What would be the best way to make the numbers correct in your tracker? Thanks!

  • @landjayc
    @landjayc 3 года назад

    Great teaching video!! Do you happen to have any sheets dealing with selling options? I use the wheeling strategy and something like this would be a great asset for me. Do you perhaps have one on your patreon page?

  • @SimplyJack3
    @SimplyJack3 3 года назад

    Well worth the patreon for the sheets.

  • @suthanawatwiangsima5660
    @suthanawatwiangsima5660 Месяц назад

    Thank you sir.

  • @thiagomanfrin1
    @thiagomanfrin1 3 года назад

    Awsome man. Great job, thanks!
    Do you know a formula or a script that show how much we sell per month and our profit per month, so we can do our taxes?

  • @ms.k4315
    @ms.k4315 3 года назад

    Thank you. Great video. very helpful. I am getting the data but also getting error at the bottom. Need to watch the video again to see if there is a way to fix it. I noticed when you added and removed, you also had similar error(n/a) but when you added something else after, it disappeared but mine is now

  • @JSimm-wv3gg
    @JSimm-wv3gg 3 года назад

    great stuff

  • @billypog3529
    @billypog3529 3 года назад

    Great vid, trying to figure out a way of tracking my investments which are held in the UK and US and that does through back some errors on the formula due to the currencies. Any simple solutions.
    My only thought at the moment was two separate spreadsheets for UK and US

  • @KamilDGE
    @KamilDGE 3 года назад +1

    HI, What about short positions? I sometimes put shorts to hedge some other positions and it seems when I first put sell and then buy it back, sheet sees only a buy. Is there a posibility to track also shorts?
    Thanks,

  • @squirrel4635
    @squirrel4635 3 года назад

    Is there a way to show every trade and every change in portfolio in a line-graph with date on the x-axis? So it is easier to benchmark it against the general market or stockprice.

  • @pngfex
    @pngfex 2 года назад

    Thank you..

  • @dmlmex
    @dmlmex 3 года назад

    is there a video for how you created the History tab?

  • @lucaslucas2789
    @lucaslucas2789 3 года назад

    Hi, do you have sheets to track fund prices?

  • @scotthansen3749
    @scotthansen3749 3 года назад

    All your work is greatly appreciated!
    Everything works fine for me with one exception. When my transaction page reached 80+ lines I get the following error - ReferenceError: activetrades is not defined (line 48). This is weird as it will work after I delete some lines from my transactions sheet. Amy advice would be helpful. Thank you!

  • @ConstantinBoubatrin
    @ConstantinBoubatrin 3 года назад +2

    Hello,
    Thank you for all.
    Could you try to add a new Action in History such as "Split" and to write the required code rows, please?
    Have a nice day.

    • @shashankvsingh
      @shashankvsingh 3 года назад

      This will be helpful if you can share how to record stock splits in the sheet?

  • @saurabhgup1983
    @saurabhgup1983 3 года назад +5

    How to we calculate the total profits or losses made for all closed positions?

    • @phyZick
      @phyZick 3 года назад

      hi, check another video from this channel. However, I've added some tweaks to formulas provided there to reflect my broker commissions

  • @robertbarrieault9297
    @robertbarrieault9297 3 года назад

    Love what you are doing. I did this video. Took a long time to get the code just right. Today I processed my first Sell order, entered it into the History tab, but it doesn't register on the Positions tab. I checked the code to make sure the word Sell was spelled the same. Checked the Data Validation, making sure no spaces or spelling error on the History tab. Everything seems to be matching up but no Sell processing.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Hmm thats interesting. Its not breaking the code or anything? You just aren't seeing the shares being sold off?

    • @robertbarrieault9297
      @robertbarrieault9297 3 года назад

      @@ThinkStocks Just the shares. The cash is working fine going back into the account. I sold ten shares of a stock, recorded it on history and the cash posted back into my available cash. But the stock share numbers did not update on the Positions tab, Breakdown tab or the Dashboard.

  • @LevShalomayev
    @LevShalomayev 3 года назад +1

    Awesome Spreadsheet!! I'm running into this Error: #ERROR! " type error: action.toUpperCase is not a function" How can fix that issue??

  • @David2580
    @David2580 3 года назад

    is it somehow possible to get the data sorted so we can see a trade histoy? Like which buy with which sell has been calculated. This would be the last improvement i could think of!

  • @user-nt5nc5hh2i
    @user-nt5nc5hh2i 11 месяцев назад

    we all guys should appreciate what he is doing for us .........love from great country india❤

  • @prashanthshastri2720
    @prashanthshastri2720 3 года назад

    Thank you for this great tutorial. Purchase price shows up perfectly in the Positions when i only have buy in the History. Moment i add a sell, position gives me error "ReferenceError: sharesTosell is not defined (line 36)" Can someone help me ?

  • @patruangdech423
    @patruangdech423 3 года назад

    I was visiting several stock tracker tutorings. This is best the stock google sheet ever. Please add sort stock by alphabet, and account tracking availability (most of us have multiple broker accounts). I plan to sign up for your Patreon.

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Thank you! I plan on making a multiple account sheet!

    • @patruangdech423
      @patruangdech423 3 года назад

      @@ThinkStocks Awesome!

    • @patruangdech423
      @patruangdech423 3 года назад

      Keith,
      Thanks for pointing it out on my google sheet. I am able to solve the error! You are right that I oversold the position (actually I have to resort to transaction date.) I am looking forward to your new video.

    • @shashankvsingh
      @shashankvsingh 3 года назад

      @@ThinkStocks Can't wait for this one!

  • @RealCapitalNotes
    @RealCapitalNotes Год назад

    Do you have a sheet that can take the transaction history and turn it into a equity curve for the portfolio so you can see what the ending balance was for the portfolio at the close of each day in the past? Would love to have something like this and certainly will to become a patron if that is something available to subscribers.

  • @soulkiller925
    @soulkiller925 3 года назад

    I got a cannot read property 'toString' of undefined (line 13)

  • @vitorpl
    @vitorpl 3 года назад +2

    Hi! Found the video :)
    Quick question, and just to confirm, sale transactions should be added with the share number in absolute format? Selling 3 shares should be added as 3 and not -3, right?

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      That is correct!

    • @DobyDuke
      @DobyDuke 2 года назад

      @@ThinkStocks my tools doesn't have script editor

  • @RaduMitrea
    @RaduMitrea 3 года назад

    The code is working perfectly for stocks, but for crypto has to be heavily modified due to the case when you exchange a coin(ticker) on a pair which is not always USD for example. This means you for eg. in same time buy a coin but also sell another.. any volunteer? :)

  • @Dirklus
    @Dirklus 3 года назад

    Hi can i get some help please. Every time i try and sell an item the positions tab says reference does not exist. i have checked lines 27 to 64 more times than i can count and rewritten multiple times and even checked to see if it matched with the name on the data validations tab but still nothing.

  • @czengineeringideas
    @czengineeringideas 2 года назад

    Hi, do you have any source how to start understanding the makros in google sheets? Or mabye what soutce to start with. Thank you.

  • @eunicepanduro8872
    @eunicepanduro8872 3 года назад +2

    Absolutely love your tutorials!
    Script works fine for me until I try to do "Sell" shares, gives me the #Error on the cell but works perfectly when i make a ass a "Buy" to the list.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Sell could cause problems if you over sell what you own. Make sure you are selling exactly what it says in your broker! Glad you like my tutorials!

    • @TerryTan81139323
      @TerryTan81139323 2 года назад

      I m facing the same problem as you. Did you manage to find the bug?

  • @mimosacrafts4613
    @mimosacrafts4613 3 года назад +1

    Thank you for such a great spreadsheet. I am having a problem with the error "Exceeded maximum execution time (line 0). Could you please advise how I can fix this issue?

    • @classicman8502
      @classicman8502 2 года назад

      Did you figure it out? Having the same issue

  • @ironchef6485
    @ironchef6485 3 года назад

    This is awesome. I am a beginner. Can you please do video how to deal with multiple accounts. I want to figure out each account's performance.

    • @ThinkStocks
      @ThinkStocks  3 года назад +3

      Glad you liked it! And im planning on doing a multiple accounts one. Alot of people have been asking me that!

  • @vishalk7801
    @vishalk7801 3 года назад +2

    Is there a way to create a Trading Journal where, when you input Transactions, the scrips get updated on the Journal Sheet along with entry and exit price and all you have to do is enter other columns like Stoploss, R2R, Strategy...manually?

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      I did create a day trading journal on Google sheets a few months back. Maybe that is similar to what you are looking for of you haven't seen that one already!

    • @vishalk7801
      @vishalk7801 3 года назад

      @@ThinkStocks I did not see that. Will dive right in.

  • @costantinomongelli4169
    @costantinomongelli4169 3 года назад

    Good morning, thank you for your very informative video, I have been using your instructions to create a tracker that has allowed me to manage my investments across multiple brokerages in one place.
    One problem I am having at the moment is with the way the F.I.F.O code is working when I sell a partial position after making several incremental 'average down purchases'. Here is the scenario:
    Purchase D 100 @ 73.84
    Purchase D 10 @ 71.50
    Purchase D 20 @ 71.26
    Purchase D 20 @ 70.95
    Purchase D 50 @ 68.32.....Total average cost basis per share was 71.80.
    I found myself a little too deep in the money on a covered call after a swift move up to 78.89 on half my position. I decided to let it go @ 72.50 and not buy back the option (which is still higher than my average cost basis). I think I still should be realizing a capital gain rather than the capital loss calculated. I know the sheet is looking solely at the first higher transaction of 100 @ 73.84 and is reflecting the loss as such without considering the adjustment to cost basis. On the other side, unrealized gains on my remaining shares is overstated as the cost basis only reflects the incremental lower purchases following the initial 100. I do realize if I sell all my stake in D, all will be right because the averages would calculate properly, but I do not have any intention to do so.
    Is there anyway the code can be slightly adjusted to consider these situations?
    Thank you kindly and I look forward to your next video.

  • @David-jv7ot
    @David-jv7ot 3 года назад

    Hey, Keith Does your Patreon not accept Paypal payments, I have tried several times but it keeps saying failed? I know I don't have a problem with my account, soi was wondering if there is a problem at that end

  • @nunofreitas8838
    @nunofreitas8838 3 года назад +1

    The "Drip" or if you want add "Dividends" that don´t add new entry! :( , see line 19!

  • @daveparth641
    @daveparth641 3 года назад

    I am getting #NUM! under purchase column. Can you please help?

  • @danielpuleo426
    @danielpuleo426 2 года назад

    Hi, I'm trying to register a short position. Please help.

  • @amynmerchant1326
    @amynmerchant1326 3 года назад

    Does this code replace the formula you had in your previous tutorials where we would enter an average weighted formula to calculate the average share price?
    Also when I try to enter a column on the left side of the price column it automatically shifts all the price values to the left into the new empty column i created. Any work around that, in case if we need to insert new columns to the left of the price column?
    Thanks

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Yes this is replacing the average weighted formula. Also make sure to delete the average weighted formula in the C column for the code to work properly!

    • @amynmerchant1326
      @amynmerchant1326 3 года назад

      Thanks.

  • @richcollins1983
    @richcollins1983 3 года назад

    ive gone through the script so many times for any mistakes and none found, execution start and finish all good to, no faults - filled out the myporfolio/mypositions bit all the same but still showing as an error (TypeError: Cannot read property 'toString' of undefined (line 12).)
    anyone with any advise please?

  • @SimplyJack3
    @SimplyJack3 3 года назад +1

    For anyone who would like to know and it may also be causing an error to show. There seems to be maximum amount of trade history lines you can have before it causes the postion sheet to just give up on running the script. I believe the max is around 200.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Hey jack, what does your function look like? I've helped people with well over 500 trade history lines with no problems

    • @SimplyJack3
      @SimplyJack3 3 года назад

      Hi, it looks exactly like the one you wrote in this video. I originally downloaded the the spreadsheets from your patreon and plugged my data in. Then I followed this video along with following the script on the sheet file and verified it was the same. I have almost 1350 transactions and that'll go up. It comes up with an error like exceeded execution time (line 0). I knew the script worked before I cleared the prefilled data. So I assumed maybe I had to much data, so I played around on the =myportfolio formula change the the 2nd number lower until it ran.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      If you are getting that error message that means you have a position that is over sold or a transaction out of order. If you buy 2.5 shares of a stock then sell 2.6 shares you will get that error message. The shares in your history tab needs to be precise

  • @criticalbasedtheory8957
    @criticalbasedtheory8957 3 года назад

    How would you show options trades?

  • @georgechurilla475
    @georgechurilla475 3 года назад +2

    How does it update your portfolio stocks

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Hey George, the code keeps track of your trades and at what prices you bought into all of them using FIFO! Then there are different functions you can put into cells to pull current market data

  • @jaffaholicshark
    @jaffaholicshark 3 года назад +1

    Thank you for this. Is it possible to link the cryptocurrency tracker to this investment spreadsheet?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Yes it is! Just use the price function in my international stock tracker tutorial. That will pull both stocks and cryptos!

    • @jaffaholicshark
      @jaffaholicshark 3 года назад

      @@ThinkStocks many thanks 🙏🙏

  • @Toohottorot
    @Toohottorot 3 года назад +1

    getting #REF! when referencing the myPositions script.

    • @Toohottorot
      @Toohottorot 3 года назад +1

      in my code I had my buy and sell actions written out as "Buy" and "Sell", but on the sheet it was "BUY" and "SELL". just updated the code to match the case of the sheet and that solved the issue for me.

    • @SimplyJack3
      @SimplyJack3 3 года назад

      This should be pinned for all of us who like to use capital letters. I did what he suggested and it worked perfectly.

  • @swapniljp889
    @swapniljp889 3 года назад

    Position data is nt getting from history sheet

  • @gelydh
    @gelydh 3 года назад

    Guys, is there any error in line 76? value.map(trade => { should not be value.Map(trade => {
    basically map with capital M instead of lower case?

  • @MrNoBSgiven
    @MrNoBSgiven 3 года назад

    1. One thing that was interesting to me about google sheets are the functions. I didn't known this existed. 2. FIFO may be the default method of selling stocks, but it is not the only one FILO is also valid. It is up to the customer to select the method. This also brings the issue of realized gain/tracking. Without recording the sell price+cost one cannot establish the reliable numbers. 3. This and previous videos are waaaay too long, and the fact you don't provide source code makes this experience less pleasant. Just an opinion.

  • @Seegon
    @Seegon 2 года назад

    Great Video! Thanks for sharing.
    I have noticed a problem or flaw with the sheet. Lets say I deposit $10k to my account. Then I buy 200 stocks for $10k (20 stocks each 1k). After some time I sell 100 of the stocks for $7K total. I then buy inn later using the $7K to get 120 stocks. In reality I've used my original $10K to get 220 stocks (22 stocks each 1k), but the code thinks I bought 220 stocks for $12k instead (18,3 stocks per 1k spent), making the deal look worse.
    Is this how it is in yours aswell, or have you found a solution for it?

  • @DavroarTV
    @DavroarTV 10 месяцев назад

    Is there a way to include brokerage fees within the code? I'd love to have these in there as well to get a more accurate calculation!

  • @eikbrynjulf2208
    @eikbrynjulf2208 3 года назад

    Hello. Greetings from Denmark.
    Good work you have done, I am a big fan and I love using your sheets to follow my stocks, I also trade stocks from the Scandinavian countries.
    I have a problem, in cell A2 there is an error message.
    ReferenceError: actions are not defined (line 14).
    Can't just see what I did wrong.
    Can you help?
    Thanks again for your good work.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Did your code properly execute when you ran it?

    • @eikbrynjulf2208
      @eikbrynjulf2208 3 года назад

      @@ThinkStocks Yes, it ran smoothly

  • @rocscott6188
    @rocscott6188 3 года назад

    Hey there, great content and journal. Unfortunately I just wanna buy the spread sheets, I don't wanna subscribe to a monthly plan. Is that possible?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Absolutely! Subscribe to patreon, download the spreadsheet (or all my spreadsheets) then unsubscribe so you are only charged that one time!

    • @rocscott6188
      @rocscott6188 3 года назад

      @@ThinkStocks got you thank you much

  • @pashtun2133
    @pashtun2133 3 года назад

    Thank you very much for the code. You have done great service to the public.
    However, I am having one problem. When I generate the code, it gives me the error saying the result is not a number. Can I send you the code to check?

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Sure thing! My email is in the about section on my channel

  • @stevenpeters4563
    @stevenpeters4563 3 года назад +1

    Question - Is it "action" or "actions" or a combination of the two? The code in the video has a combination. I've had someone tell me they changed one or some of the "actions" to "action" and it worked. I cannot find the combination. Running "generateTrade" works fine. But the other two I get these errors:
    Getting error - "TypeError: Cannot read property 'length' of undefined. generateFifo @ Code.gs:11 MyPositions @ Code.gs:69

  • @carmelcohen835
    @carmelcohen835 3 года назад +1

    awesome video but its import to me all the stocks i ever trade, include the ones that shares is 0

    • @ildzikf
      @ildzikf 3 года назад

      Nice video, i also created this one, but when i try to sell all stock after my second or third buy with the same stock, that stock not disappear on positions tabs.

  • @vishwaasewgobind2183
    @vishwaasewgobind2183 3 года назад +1

    Can this be used on the previous master tracker as a fix or will it ruin the entire sheet?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Yes! But you need to make sure your clear out the purchase function in column C of the positions tab

    • @dhakshanamoorthy8073
      @dhakshanamoorthy8073 3 года назад

      @@ThinkStocks i applied the code for the old portfolio tracker sheet, and purchase column function also deleted, but ERROR is showing.. what is wrong?? whether i should keep the script file existing or delete that???

  • @thiagomanfrin1
    @thiagomanfrin1 3 года назад +1

    By using this Fifo scrip
    Buy stock - 10 shares - 10.00
    Buy stock - 10 shares - 20,00
    Sell stock - 7 shares - 15,00
    Average Purchase = U$ 17.69
    it substract --> 10 inicial shares - 7 sold shares = 3 remaining x 10,00 purchase = 30,00
    then Adds 10 shares bought x 20,00 = 200,00
    Purchase total --> U$ 230,00 / 13 stocks remaining = U$ 17,69 purchase
    or i did something wrong with the script?

  • @argoskier
    @argoskier 3 года назад

    Hello, and thanks for the great work. I just want to make sure that your FIFO formula is actually using the date entered and not just the order it is placed in the spreadsheet. Also, the reason I chose your video in the first place was that you were not having the realized gains show up, which I liked. But I do still want to keep track of realized gains. Is there an easy formula to keep track of realized gains for each ticker that you could share? Thank you.

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      The code reads the transactions in order so the entire must be in date order to properly calculate. And not yet but ill see if I can come up with something!

    • @argoskier
      @argoskier 3 года назад

      @@ThinkStocks aha. ya, that's what I thought....So do you think I can just sort the date column and that will fix the FIFO without screwing anything else up?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Yes!

    • @argoskier
      @argoskier 3 года назад

      @@ThinkStocks Oh, that is good news. Great, thanks again!

    • @argoskier
      @argoskier 3 года назад +1

      Man, Idk what changed but it stopped working. I now get this error when running script:
      11:01:58 AM Notice Execution started
      11:01:59 AM Error
      TypeError: Cannot read property 'length' of undefined
      generateFifo @ myPositions.gs:12
      myPositions @ myPositions.gs:69
      here is line 12: for(var i = 0; i

  • @MrThiruChandru
    @MrThiruChandru 3 года назад

    Waiting for your add on features.

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Oh its coming! few months down the road but it will be worth the wait!

  • @puru1711
    @puru1711 3 года назад +1

    My sell and buy options working fine. but cash deposit details are not getting fetched from history tab. Pls help.

  • @diegoisola7249
    @diegoisola7249 3 года назад

    @think stocks is it ok if instead of creating a new blank spreadsheet with myPositions.gs , I edit the Master Portfolio Tracker spreadsheet I downloaded from your Patron and add myPositions.gs? I am not a developer so in case the latter is possible, I see your Code.gs script in the Master Portfolio Tracker spreadsheet and I'm afraid it would generate conflicts with myPositions.gs? Also do you know how I would go about copying the myPositions.gs script from my blank spreadsheet and pasting it in the Master Portfolio Tracker spreadsheet? Thanks!

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Yeah you easily just copy and paste the scripts!

  • @marnixvdb5537
    @marnixvdb5537 3 года назад +1

    Thank you for this update! However, the numbers beneath “Purchase” give me an error saying the result is not a number, do you know how this can be solved?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Are you trading no us stocks?

    • @marnixvdb5537
      @marnixvdb5537 3 года назад

      @@ThinkStocks Yes, but to test it out I only used US stocks and it still gave me the same error, could I otherwise send you an email with the code?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Sure! You can email me it. Better yet share your tracker with me. The code might be right, but there might be a different error in your sheets

    • @christopherfleming7505
      @christopherfleming7505 3 года назад

      This happened for me also. If you are not American, you may write numbers differently. In Europe one million is "1,000,000" instead of "1.000.000". A small number with decimal places could be "1.34", for example, instead of "1,34", with a comma instead of a dot. Google detects "1.34" as a text, not a number, which is perhaps your problem. Anyway, that is what happened to me. Hope that helps!

    • @sujitxyz
      @sujitxyz 2 года назад

      @@ThinkStocks Thank you very much sir!
      I am from India, it works fine here also.

  • @Sergiojunior08
    @Sergiojunior08 3 года назад

    In the moment 41:35 is an error??? Is value or vaule??

  • @hagaioren3439
    @hagaioren3439 2 года назад

    why i get this nassage " action is not defined line 13

  • @vimalkumar-sr6lx
    @vimalkumar-sr6lx 3 года назад +1

    Hello Think Stocks.. Videos are amazing. Your link shows to pay 4.99$ per month. Is it possible to download the google sheets?Once I download the google sheet can I use it myself or should I pay 4.99$ every month to use it? Regards

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      You can pay once download the sheets that you want then unsubscribe from my patreon so it only charges you that one time

    • @vimalkumar-sr6lx
      @vimalkumar-sr6lx 3 года назад

      Thank you

  • @andreslbandre
    @andreslbandre 3 года назад +3

    Great Work,
    When I run the code it executes very well.
    When I try to put the Formula in positions (=myPositions(History!B2:B1000;History!C2:C1000;History!D2:D1000;History!E2:E1000) it says name? "unknown function)
    What should I do?

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Hmm it could be a few things. Make sure your history tab is free of any errors, and make sure your first 3 columns in the positions tab has no other formulas in any cells other than the myPortfolio formula

    • @andreslbandre
      @andreslbandre 3 года назад +1

      @@ThinkStocks Thanks for fast reply, but keep saying #Name (Unknown function: myPosition)

    • @edwinalansilvatorres544
      @edwinalansilvatorres544 3 года назад +1

      @@andreslbandre Try this =myPositions(Go to tab History and select the columns B,C,D,E) you should have this at the end: =myPositions(History!B:B,History!C:C,History!D:D,History!E:E)

  • @jobpeters7945
    @jobpeters7945 3 года назад

    Is this code posted somewhere, on Patreon maybe? I am running into errors. Would be nice to be able to copy-paste it haha

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Yes my code and every tracker I've uploaded to RUclips is on my patreon! Link is in the description

  • @drusannutda
    @drusannutda 3 года назад +4

    How about dealing with stock splits?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      That one I have not solved yet... But when I do there will be a video for it!

    • @drusannutda
      @drusannutda 3 года назад +1

      @@ThinkStocks Thank you, appreciate your time

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Interesting!

    • @shashankvsingh
      @shashankvsingh 3 года назад

      @@ThinkStocks Did you get chance to verify if the above tick works :)

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Yes! This Friday I will release a new master portfolio tracker with an updated code that accounts for stock splits!

  • @denil20
    @denil20 3 года назад

    Sir if drip added in history drip particular stock showings in positions please tell solutions.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Drip is supposed to add to your position in the positions tab. If you don't have DRIP on then it should be Dividend

    • @denil20
      @denil20 3 года назад

      @@ThinkStocks ok got it thanks sir

  • @zaccoza
    @zaccoza 3 года назад

    Hello @Think Stocks, Can you suggest me an alternative payment method to purchase this file?
    I do not use credit card. I am using a debit card. and I want to do the importance with this.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Debit cards will also work with my Patreon

    • @zaccoza
      @zaccoza 3 года назад

      @@ThinkStocks Unfortunately, all my attempts fail. Does not accept debit cards.
      message: "your payment to Keith Frislid didn't go through."

    • @zaccoza
      @zaccoza 3 года назад

      @@ThinkStocks Payment by debit card was successful, thank you.
      With the Fifo method, you have finished the average price problem. It has been a great program. Congratulations...

  • @martinsgagainis1772
    @martinsgagainis1772 3 года назад

    Awesome work @ThinkStocks, can you please help, got #NUM = result is not number error in positions sheet for Shares and Purchase

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Hmm, you have no syntax errors in your code?

    • @martinsgagainis1772
      @martinsgagainis1772 3 года назад

      @@ThinkStocks nope all looks good, going thru one more time. but got rid of all grey elements

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      If you want you can send me a copy of your sheet and I can take a look at it for you. My email is in the about section of my channel

    • @martinsgagainis1772
      @martinsgagainis1772 3 года назад

      @@ThinkStocks just did it

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Okay cool. As soon as I get to my laptop ill take a look at it for you!

  • @robira1313
    @robira1313 3 года назад

    You seem to have an abundant knowledge of google sheets. Is there a way to formulate a cell to see yesterday's
    value of my stocks? (sum total of a column.) This way I can see the gain/loss for the day. My Schwab acct lists it as "day's change".

    • @ThinkStocks
      @ThinkStocks  3 года назад

      So google finance has a function to pull yesterday's close price. The function would be =googlefinance(A3,"closeyest"). Obviously A3 is assuming thats where your ticker is. Hope this helps!

    • @robira1313
      @robira1313 3 года назад

      No one seems to understand my question. I am not looking for yesterday for any ticker. There is a SUM TOTAL of my gains for yesterday and a sum total of my gains for today. How much increase/decrease has occurred? There must be a way to do this. I am not looking for ticker prices or closing prices. My Schwab acct lists it as "day's change".

    • @ThinkStocks
      @ThinkStocks  3 года назад +1

      Ohh okay, so the best way to do this is find the change in all your positions which googlw finance has dollar change and % change and some them all together. I do this in my master portfolio tracker video on the dashboard. Warning It will not be as accurate as your broker because Google finance has a 20 minute delay

  • @dylanrobertson6963
    @dylanrobertson6963 3 года назад

    After adding the new function my positions tab is now showing that none of my positions have ever been closed out... Any idea how to fix?

    • @dylanrobertson6963
      @dylanrobertson6963 3 года назад

      Actually just figured this out myself... If anyone is having the same issue, you just need to change how many shares sold in history tab from negative to positive numbers.

  • @boerenmotor
    @boerenmotor 2 года назад +1

    This is a great tracker, but I can't get it to work. Script runs without errors. When I call the function in the positions tab I get #REF! (reference does not exist). History tab looks fine too. I had the exact same issue with your previous tracker as well for some reason.

    • @patrickvo3824
      @patrickvo3824 2 года назад +2

      i got the same issues. i have double, and triple my script and found no errors, however I get #REF! (reference does not exist). can anyone help please

  • @rocscott6188
    @rocscott6188 3 года назад

    I bought all the journals from. And have a few questions how can I email you? I cancelled my membership after I downloaded the drive.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Hey Roc, sure, you can find my email on my channel in the about tab

  • @swishdaily4034
    @swishdaily4034 3 года назад

    Hey! None of the formulas on the Positions Tab that you show at 54:03 work after updating to the newest code you showed earlier in the video. If those formulas dont work then I am assuming I would be unable to finish the dashboard too. Please advise!

    • @ThinkStocks
      @ThinkStocks  3 года назад

      I just checked and the code is still working on my end

    • @ThinkStocks
      @ThinkStocks  3 года назад

      What error message are you getting?

    • @DevinPossinger
      @DevinPossinger 3 года назад

      @@ThinkStocks should we still use =if(isblank) like the last video?

    • @ThinkStocks
      @ThinkStocks  3 года назад

      So in your purchase price column there should be no functions. Column a, b, and c need to be free of any functions other than the myPositions function to work

  • @cremberry6229
    @cremberry6229 3 года назад

    @thinkstocks the drip and dividend function doesnt work as it doesnt actually add to my position or show up in the cash available

    • @ThinkStocks
      @ThinkStocks  3 года назад

      there could be a syntax error on your end that is causing the function to not work properly. Make sure there are no spaces and the capitalization is the same as the code. Hope this helps!

    • @cremberry6229
      @cremberry6229 3 года назад

      @@ThinkStocks that was weird i had to do all lower case then all upper case for it to work. thanks a bunch man.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Glad it works for you now!

  • @VijayKumar-ou2vp
    @VijayKumar-ou2vp 3 года назад +1

    Hi, I am getting Error message Unknown function: 'myPositiobs'. Is it because of Google Chrome...? Which browser to use for Google sheet

  • @Ahmed-ry8qd
    @Ahmed-ry8qd 3 года назад +1

    I think that the function is still a little bit bugy when it comes to calculating the avg price.
    In my use case f.e. for stock XY it doesn't calculate the avg. price correctly.
    XY Buy 80 $34
    XY Buy 10 $43
    XY Buy 10 $42
    XY Sell 43 $37
    XY Buy 5 $36
    XY Sell 37 $38
    The avg. price for the example above would be something around $36 but what I get is $41.

    • @ThinkStocks
      @ThinkStocks  3 года назад

      What are the prices and what results are you getting?

    • @Ahmed-ry8qd
      @Ahmed-ry8qd 3 года назад

      @@ThinkStocks Hi, these are buying and selling prices. F.e. 80 shares * $34 equals $2720. With the old function the avg price was calculated correctly. I ve implenented your new function and for this specfic case it doesn't work. For the other use case f.e. buying 100 shares of an company selling 100 shares and rebuying again it works.

    • @Ahmed-ry8qd
      @Ahmed-ry8qd 3 года назад +1

      @@ThinkStocks Figured it out, I made a mistake in my formula :).

    • @ThinkStocks
      @ThinkStocks  3 года назад

      Okay awesome!

    • @mathmatrix43
      @mathmatrix43 2 года назад

      @@Ahmed-ry8qd I am facing the same issue in calcualting average price. Can you tell what was the fix you had done in the formula ?

  • @PavanKumar-hx4kn
    @PavanKumar-hx4kn 3 года назад

    #ERROR! RferenceError:generatTrade I not defined (line17).

  • @patrickvo3824
    @patrickvo3824 2 года назад

    i have double, and triple check my script but found no errors, however I get #ref! (reference does not exist). can you please help, Thank you!

  • @jamiereyna2646
    @jamiereyna2646 3 года назад

    I successfully created the code in script editor but when i attempt to insert it into my "positions" tab like you do, i get a #NAME? error. From what i can tell, i did everything verbatim like you did. Is there something else I might be missing that you may have done differently? I also get a #REF! error

    • @ThinkStocks
      @ThinkStocks  3 года назад

      It could be a few things. First I would recommend testing the code by depositing 10,000 cash, buying 10 shares of AAPL at 100, Selling 5 at 150, then buying another 5 at 200. See if that populates 5 shares of AAPL at 150. If so then the code and function are fine and you might have an error in your transactions