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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X