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 futtrader, 04-21-2024, 01:50 AM
    6 responses
    57 views
    0 likes
    Last Post futtrader  
    Started by sgordet, Today, 11:48 AM
    0 responses
    1 view
    0 likes
    Last Post sgordet
    by sgordet
     
    Started by Trader146, Today, 11:41 AM
    0 responses
    3 views
    0 likes
    Last Post Trader146  
    Started by jpapa, 04-23-2024, 07:22 AM
    2 responses
    18 views
    0 likes
    Last Post rene69851  
    Started by funk10101, Today, 11:35 AM
    0 responses
    1 view
    0 likes
    Last Post funk10101  
    Working...
    X