• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Time Frame Coding

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

    Multiple Time Frame Coding

    Hello,

    How do you code the following on a 15 minute chart

    " If EMA 34 on the 6 hour chart is falling and EMA 34 on the 15 minute chart is falling
    and Stochastics 5.3.3 >= 80 and Stochastics 5.3.3 is falling " Then " Play sound....."

    Thx.

    Regards

    Rene

    #2
    Hello Rene,

    Thank you for your post.

    You will want to use the Add(); to add an additional timeframe to the script for calculations

    In the Initialize()
    Add(PeriodType.Minute, 15);


    Please take a look at the link below on programming with Multiple Timeframes and Instruments -
    http://www.ninjatrader.com/support/h...nstruments.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by rzeemeijer View Post
      Hello,

      How do you code the following on a 15 minute chart

      " If EMA 34 on the 6 hour chart is falling and EMA 34 on the 15 minute chart is falling
      and Stochastics 5.3.3 >= 80 and Stochastics 5.3.3 is falling " Then " Play sound....."

      Thx.

      Regards

      Rene
      You basically have two options.

      -> either you add a 360-min bar series in the Initialize() section of the indicator and perform the EMA calculation for that bar series
      -> or you replace the EMA(34) on a 6-hour chart with the EMA (816) on a 15 minute chart (they are near-identical)

      I would prefer the second option. As the EMA is a recursive indicator, there is no risk that the large period of 816 will slow down the indicator. 816 is the product 24 x 34, because one 6-hour bar can be built from 24 15-min bars. This reasoning can also be applied to a SMA.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by JMont1, Today, 11:42 AM
      0 responses
      4 views
      0 likes
      Last Post JMont1
      by JMont1
       
      Started by ryanmercado, Today, 10:04 AM
      0 responses
      3 views
      0 likes
      Last Post ryanmercado  
      Started by uiwislth, Yesterday, 11:25 PM
      0 responses
      5 views
      0 likes
      Last Post uiwislth  
      Started by Steve L, Yesterday, 10:04 PM
      0 responses
      4 views
      0 likes
      Last Post Steve L
      by Steve L
       
      Started by marianfed, Yesterday, 09:47 PM
      0 responses
      5 views
      0 likes
      Last Post marianfed  
      Working...
      X