Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars required to trade

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

    Bars required to trade

    ok. basic question of interpretation.

    for my strategy, i have kept bars required to trade=20

    what that means,

    does that mean, on 5 minute chart, when I enable strategy, at 5 PM CST,

    no entries will be executed by strategy until we reach at 6:40 PM CST (means 5 minutes x 20 bars= 1 hr 40 minutes= 6:40 PM).

    is that true?

    ----

    or does strategy rather consider to have previous 20 bars loaded in the system? i want to get this clarity.

    give me example based explanation please.


    #2
    Hello manitshah915,

    Thank you for your post.

    BarsRequiredToTrade takes historical bars into account, so with your example of BarsRequiredToTrade = 20, the bars previously loaded will be considered as well. If you enabled a strategy on a 5-minute chart with BarsRequiredToTrade set to 20, but that chart has 3 days of data loaded, then there will already be over 20 bars in the series by the time the strategy is enabled so it could start submitting trades immediately depending on the logic and if the entry conditions are met.

    For more information, please see the help guide page here:


    Please let us know if we may be of further assistance.

    Comment


      #3
      hi. but when i load strategy from control center, not via chart..then what happens? does system load past 3 days of data virtually? or do i have to keep the chart open too?

      Comment


        #4
        Originally posted by manitshah915 View Post
        hi. but when i load strategy from control center, not via chart..then what happens? does system load past 3 days of data virtually? or do i have to keep the chart open too?
        When running a NinjaScript strategy from the Strategies tab of the Control Center, there is still a property under "Time Frame" in the strategies window where you select the number of days to load. Ultimately, to get a deeper understanding of how this works, I suggest adding a print statement to your strategy that prints both the CurrentBar value as well as the BarsRequiredToTrade value so you can see this information in the NinjaScript Output window. Here is an example of a print you could add in OnBarUpdate():
        Print(Time[0] + " CurrentBar: " + CurrentBar + " BarsRequiredToTrade: " + BarsRequiredToTrade);

        Please let us know if we may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        25 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        25 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-25-2026, 09:53 PM
        0 responses
        30 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 03-25-2026, 09:51 PM
        0 responses
        18 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 03-23-2026, 11:13 AM
        0 responses
        28 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X