Announcement

Collapse
No announcement yet.

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:	272
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.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    163 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    81 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    125 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    206 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    184 views
    0 likes
    Last Post CarlTrading  
    Working...
    X