Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.FirstBarOfSession

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

    Bars.FirstBarOfSession

    I am using Bars.FirstBarOfSession to do a logic check when the market opens but it is returning false on the first bar. I am using it with FESX 0615 1min bars and CalculateOnBarClose is set to true. Could this be because it will only be true when the bar closes?

    #2
    Hello,

    Thank you for the question.

    Yes this would apply to the CalculateOnBarClose or the Close of the bar as well. If you are running COBC true, it would be the close of the bar otherwise with COBC false it would be the first tick of the bar that the session has started on.

    I look forward to being of further assistance.

    Comment


      #3
      Hi Jesse

      OK I thought that was the case so I added tick bars to process Bars.FirstBarsOfSession on the first tick that comes in. This didnt work either and after going through the program flow with MS Visual Studio there is data coming in after 8.00 am CET which not from the current session. When I try and use Bars.BarsSinceSession for my logic it doesnt work either of course as it is considered bars from the last session and the int getting returned is in the order of 850.

      All of this means I have no way of processing logic when the market opens. I am running the strategy on FESX 09-15 on 6th July 2015.


      I looked at the data coming in again and because I have COBC = true when the market opens at 8 am it processes the close of the bar from the day before. So my logic then works off that close which is much higher then the opening tick of the current session. This is causing the problem. Is the only way around this to include a time condition?


      I solved the problem with :-

      Code:
      if(ToTime(Time[0])> 215900)
      	return;
      Last edited by GKonheiser; 09-24-2015, 04:34 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      56 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      160 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      96 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      276 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X