• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Total Return of a Stock/ETF

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Total Return of a Stock/ETF

    Is there anyway to get the total return for a stock (including dividends) ?

    #2
    Hello GrumpyTrader,

    Thank you for your note.

    This would need to be calculated manually or through code.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Patrick, but how would I do it via code. The issue I have is getting the dividend yield historically. Is there a way to do that?

      Comment


        #4
        Hello,

        The only way I could think you could do this would be to check the BarTime and compare that to the times in the list of Dividends in the MasterInstrument.

        There is no documentation on this so I can not provide much, I can provide the following syntax which would assist in getting the actual values and dates of the dividends for the instrument:

        Code:
        foreach (Dividend dividend in Instrument.MasterInstrument.Dividends)
        {
                Print("Date: " + dividend.Date + " Amount: " + dividend.Amount);
        }
        This would loop through the Dividends for this specific instrument.

        From there you could do other logic such as compare the current Bars Time to see which dividend would apply and then do your calculations as needed from there.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          BarChart data

          I noticed that BarChart data comes adjusted for splits and dividends as compared to other providers such as IB, IQFeed, and Kinetick. Does that mean only the historical data is adjusted or the real-time data is adjusted at the BarChart server before being fed to you?

          Comment


            #6
            Hello,

            Yes that would be correct, you can locate which data providers do this already in this document: http://ninjatrader.com/support/helpG...lightsub=split

            Please ensure to ask new questions as new threads in the future.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Vincere, Today, 01:59 AM
            0 responses
            4 views
            0 likes
            Last Post Vincere
            by Vincere
             
            Started by Davoone1, Yesterday, 07:28 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Started by Bobisam, Yesterday, 10:53 PM
            1 response
            8 views
            0 likes
            Last Post Bobisam
            by Bobisam
             
            Started by quantera, Yesterday, 05:38 PM
            0 responses
            5 views
            0 likes
            Last Post quantera  
            Started by ciro1963, Yesterday, 03:58 PM
            0 responses
            6 views
            0 likes
            Last Post ciro1963  
            Working...
            X