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
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by t.kelly4149, Today, 05:36 PM
    1 response
    5 views
    0 likes
    Last Post bltdavid  
    Started by SilverSurfer1, Today, 06:29 PM
    0 responses
    16 views
    0 likes
    Last Post SilverSurfer1  
    Started by trader3000a, Today, 01:06 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by marcus2300, Today, 11:45 AM
    3 responses
    31 views
    0 likes
    Last Post marcus2300  
    Started by pel11, Today, 11:06 AM
    0 responses
    13 views
    0 likes
    Last Post pel11
    by pel11
     
    Working...
    X