Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

BarsSinceSession

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

    BarsSinceSession

    Hi,

    When trading forex, I noticed that the Bars.BarsSinceSession returns a value of 1 at the start of the new trading session (5pm EST) but also at 12:00 midnight.. Is there any way to solve this? I'm only interested in the 5pm EST point in time.

    #2
    Hello siroki,

    Thanks for your post.

    What session template are you using?

    What forex instrument(s) are you using?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      I am using the Forex template with the following settings:


      It happens on all forex pairs.

      When I enter the following code within the OnBarUpdate() statement I get the results:

      Code:
      			if(Bars.FirstBarOfSession) { 
      				Print(Time[0].ToString());
      }
      7/1/2015 5:02:00 PM
      7/1/2015 5:30:00 PM

      I know there is a non-tradeable period between 5pm and 5:30pm but I would think the session is marked at 5pm.
      Last edited by siroki; 07-06-2015, 01:21 PM.

      Comment


        #4
        Hello,

        Thanks for your reply.

        I used:

        Code:
        if(Bars.FirstBarOfSession && FirstTickOfBar) 
        { 
        Print(Time[0].ToString());
        }
        At first I too had a print at Midnight on some days. I then reloaded all historical data and that cleared up the issue. Please try reloading your historical data and testing again.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by knowmad, Today, 03:52 AM
        0 responses
        14 views
        0 likes
        Last Post knowmad
        by knowmad
         
        Started by tradingnasdaqprueba, Today, 03:42 AM
        0 responses
        10 views
        0 likes
        Last Post tradingnasdaqprueba  
        Started by Haiasi, 04-25-2024, 06:53 PM
        4 responses
        63 views
        0 likes
        Last Post effraenk  
        Started by ccbiasi, 11-23-2017, 06:06 AM
        5 responses
        2,207 views
        0 likes
        Last Post leodavis  
        Started by kujista, Yesterday, 12:39 AM
        2 responses
        14 views
        0 likes
        Last Post kujista
        by kujista
         
        Working...
        X