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

Questions about multi-timeframe

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

    Questions about multi-timeframe


    Hi,

    Would you please help to check why my multi-time frame strategy is not work?
    My bar zero is MSFT 1 minute. My bar one is 1 Day. ( AddDataSeries(BarsPeriodType.Day, 1)
    but if I change bar one to 10 minute, ( AddDataSeries(BarsPeriodType.Minute, 10)

    Thanks.



    Attached Files

    #2
    Hello heiheilau,

    Thanks for your post.

    Please clarify the following so we may accurately assist.

    What specifically is not working in regards to your strategy?

    Are you wanting to EnterLong() when the close price of the primary data series (Closes[0][0]) is greater than the previous close price of the secondary added data series (Closes[1][1])?

    If so, please see the attached example script which demonstrates this.

    See this help guide for detailed information about working with Multi-timeframe scripts: https://ninjatrader.com/support/help...nstruments.htm

    Also, see the SampleMultiTimeFrame example script which comes default with NinjaTrader. To view the script, open a New > NinjaScript Editor window, open the Strategies folder, and select the SampleMultiTimeFrame script.

    I look forward to assisting further.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thanks. After adding below scripts. It is work now for both Day series and Minute series. Thanks again

      if (CurrentBars[0] < BarsRequiredToTrade || CurrentBars[1] < BarsRequiredToTrade)
      return;if (CurrentBars[0] < BarsRequiredToTrade || CurrentBars[1] < BarsRequiredToTrade)
      return;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AttiM, 02-14-2024, 05:20 PM
      12 responses
      213 views
      0 likes
      Last Post DrakeiJosh  
      Started by cre8able, 02-11-2023, 05:43 PM
      3 responses
      238 views
      0 likes
      Last Post rhubear
      by rhubear
       
      Started by frslvr, 04-11-2024, 07:26 AM
      8 responses
      117 views
      1 like
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      10 responses
      47 views
      0 likes
      Last Post stafe
      by stafe
       
      Started by rocketman7, Today, 09:41 AM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X