Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting just 24 hours Forex trades

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

    Getting just 24 hours Forex trades

    Hi Ninjas,

    I´m trying to fix an issue in the Strategy Analizer, cause when an optimization for a normal 24 hours Forex session is required ( For intraday purpose ) you'll get results that include trades out of that daily range. So, since I´m not a programmer, I was reading and I found something helpful, the "Bars.Session.GetNextBeginEnd". I discovered that I can know in that datetime format, which are my sessionBegin and my sessionEnd, but now I want to know:

    How can I call the Datetime of the current Bar (in the same format used for sessionEnd ) in order to compare if it continues to be within the same range?

    I was playing with Bars.GetDayBar(0).Time but it doesn't work

    Thanks

    #2
    Hello pstrusi,
    To get the time of the current bar simply use Time[0]. Please refer to our help guide to know more about it.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks Joydeep.

      As always, every time I solve some issue with your help, I post here how I did it.

      In this case, to obtain just the 24 hours trades in forex session, I added this at first to the code:

      if (Bars.FirstBarOfSession)
      Bars.Session.GetNextBeginEnd(BarsArray[0], 0, out sessionBegin, out sessionEnd);
      if (Time[0] < sessionEnd)
      {
      the code
      }

      Comment


        #4
        Hello pstrusi,
        Glad you could work it out.

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Please Joydeep, transmit this issue solved to Bertrand, cause it was thought to be included in the next major NT upgrade, and maybe there´s even an easier way to solve it, since I´m not a programmer, but at least I solved :-)

          Comment


            #6
            Hello pstrusi,
            Thanks for letting me know. I will inform Bertrand regarding it.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by PaulMohn, Today, 09:12 AM
            0 responses
            2 views
            0 likes
            Last Post PaulMohn  
            Started by thumper57, 05-11-2024, 04:30 PM
            13 responses
            38 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by llanqui, Yesterday, 10:29 AM
            2 responses
            15 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by llanqui, Yesterday, 11:10 AM
            2 responses
            22 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by eladlevi, Today, 08:41 AM
            3 responses
            5 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X