Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print at EOD with an indicator attached to Market analyzer

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

    Print at EOD with an indicator attached to Market analyzer

    Hi community,Click image for larger version

Name:	eod.png
Views:	50
Size:	23.8 KB
ID:	1316296
    I have an indicator that is attached to Market Analyzer with the attached settings.
    Code:
    protected override void OnBarUpdate()
    {​
    Print (Instrument.FullName + " " + Close[0]);
    }
    At end of the day, I got no print-outs. Would you please help?
    Thanks.

    #2
    Hello MSerag,

    By end of day do you mean the last bar on the chart? You are using a daily series with the indicator so its final bar will not close until the open the following session.

    Comment


      #3
      Yes, it is the last bar of the chart. It is last daily bar.
      Then, how can I print the close at the end of the trading day once the day ends at RTH (4:00 pm)?

      Comment


        #4
        Hello MSerag,

        You would need to use a less granular series however any series will not close until the following session opens. Because Bar Close events are being observed we have to wait for the first tick of the following bar to close the current bar. Using a more granular series you could print the close slightly before the end of the session, for example if the last bar is 4pm bar you could print the close at 3:59 instead.
        Last edited by NinjaTrader_Jesse; 08-30-2024, 09:17 AM.

        Comment


          #5
          Do you mean that I should execute the indicator via Calculate at each tick, then make a condition to print the close after or equal to 3:59 pm?
          I think that this is not a good way to go because there might be not ticks from 3:59 until 4:00 pm.
          Also, I cannot do this after 4:00 pm because the data is RTH only.

          Comment


            #6
            Hello MSerag,

            You can use calculate OnEachTick to get the ticks leading up to the close however that bar will only fully close once the following session has started. This would also really depend on the market you are trading. To execute logic there needs to be market data, if there is no data between 3:59 and 4 then your logic won't be executed during that time.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X