Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Specify timeframe from which to get Indicator values

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

    Specify timeframe from which to get Indicator values

    Hello,

    I am developing a strategy where I have a few conditions for indicator values, e.g.:

    - indicator x is greater than 1 ("1" created as a variable) on daily time-frame
    - indicator y is greater than 2 ("2" created as a variable) on 3 minute time-frame

    It needs to be incorporated into the strategy but I could not find a way to do this using strategy builder - is there a way to do it with the builder?
    If not, I assume I will unlock the code and add it in the script. I know I need to use Add(PeriodType.Minute, 3) for example but I cannot find a way to indicate following:

    - indicator x - get value from daily and then see if the value meets the condition
    - indicator y - get value from 3-minute and then see if it meets the condition

    I did a lot of research and followed tutorial for strategy builder but didn't find anything that would answer my question, apologies if this is too trivial.
    Thanks a lot for any feedback.
    David

    #2
    Hello Paco0,

    Thanks for your post.

    There are a couple of approaches.

    1) Modify the indicators to provide a "transparent" colored plot that outputs a signal level (It looks like you are using values of 1 & 2) when their conditions are true and a zero when they are not. The indicators can then be used in the strategy builder and their signal plots can be used as part of the conditions. In the strategy builder you would need to add the time frames of daily and 3 minute and then assign those to the indicators for use as their data source. Once the other time frames are added you can assign the time frames through the "Data series" selection for the indicators. If the chart where you are applying the strategy is a 3 minute series then you do not need (or want) to add the 3 minute series in the strategy as the script will adopt/use the chart bars.

    Note, anytime you access daily bars and are using intraday data to trade with, be aware that you will likely have to load more days of data overall. You may also need to change the BarsRequiredToTrade value. Reference: https://ninjatrader.com/support/help...redtotrade.htm

    2) Work in Ninjascript as you suggested, you might find it easier to incorporate the indicator coding within the strategy although you could take the same approach as suggested above (transparent plots) if you wanted to keep things separate. Multi time frame coding in Ninjascript requires a number of considerations and this section of the help guide is written to give you the best understanding of all the considerations: https://ninjatrader.com/support/help...nstruments.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    66 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    141 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X