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

multi-time frame code and entry code

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

    multi-time frame code and entry code

    I'm using a mult-time frame strategy. I've referred to the help guide, but still have questions in two areas:

    1. Is it best to use the barsinprogress ==0 for multi-time frame instead of barsinprogress !=0?

    1a.If using ==0 format and you want to check the 1 minute chart as well as other time frames, should you be including in your time frame code:
    // Add a 1 minute Bars object to the strategy
    Add(PeriodType.Minute, 1);

    or is the 1 min. time frame automatically assumed under the ==0 format?

    2. Where do you place an enterlong() code on a multi-time frame strategy? I want an entry to occur only when the strategy conditions exist on all timeframes simultaneously.

    Should the enterlong() code occur only once at the end of the code after all if statements have been written, or should it occur after each and every timeframe's if statement?

    #2
    1. Depends what you want to do. If you want to process OnBarUpdates for the primary series then you need to filter using == 0.

    1a. If your primary series is NOT 1 min, then yes, you must add it. If its the primary then it will have an index of 0 --> Refer back to answer #1

    2. Only once
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sidlercom80, 10-28-2023, 08:49 AM
    168 responses
    2,262 views
    0 likes
    Last Post sidlercom80  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by WeyldFalcon, 12-10-2020, 06:48 PM
    14 responses
    1,429 views
    0 likes
    Last Post Handclap0241  
    Started by DJ888, 04-16-2024, 06:09 PM
    2 responses
    9 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    41 views
    0 likes
    Last Post jeronymite  
    Working...
    X