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

Conditions at different time frame

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

    Conditions at different time frame

    Hello
    How can I make a condition (like cross above/below) at a different time frame than the chart on a strategy. for example, I defined a 1 min time series and set the below condition but the stratgy does not work on a 5 min or different time. Please advise
    Click image for larger version

Name:	image.png
Views:	109
Size:	24.7 KB
ID:	1271917

    #2
    Hello al.kooh,

    Thanks for your post.

    This would require unlocking the code of the strategy from the Strategy Builder by clicking the 'Unlock code' button and manually programming your strategy to suit your overall goals.

    If the 5-minute data series is the first secondary series added to the script then this series would have a BarsInProgress value of 1. The primary data series the script is running on would have a BarsInProgress value of 0.

    You would place all your logic that you want to process on the 1-minute series within a condition that checks if (BarsInProgress == 0). Then, place the logic you want to process on the added 5-minute series within a condition that checks if (BarsInProgress == 1).

    Please see the help guide documentation below for more information.

    AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm
    BarsInProgress: https://ninjatrader.com/support/help...inprogress.htm
    Working with Multi-Timeframe/Multi-Instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm

    Also, review the SampleMultiTimeframe and SampleMultiInstrument reference samples that come default with NinjaTrader. To view these files, open a New > NinjaScript Editor window, open the Strategies folder, and click on the SampleMultiTimeFrame or SampleMultiInstrument file.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by LiamTwine, Today, 08:10 AM
    0 responses
    2 views
    0 likes
    Last Post LiamTwine  
    Started by Balage0922, Today, 07:38 AM
    0 responses
    5 views
    0 likes
    Last Post Balage0922  
    Started by JoMoon2024, Today, 06:56 AM
    0 responses
    6 views
    0 likes
    Last Post JoMoon2024  
    Started by Haiasi, 04-25-2024, 06:53 PM
    2 responses
    19 views
    0 likes
    Last Post Massinisa  
    Started by Creamers, Today, 05:32 AM
    0 responses
    6 views
    0 likes
    Last Post Creamers  
    Working...
    X