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

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 traderqz, Yesterday, 09:06 AM
      3 responses
      21 views
      0 likes
      Last Post NinjaTrader_ThomasC  
      Started by f.saeidi, Today, 10:19 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by kujista, Today, 06:23 AM
      5 responses
      17 views
      0 likes
      Last Post kujista
      by kujista
       
      Started by traderqz, Today, 12:06 AM
      3 responses
      6 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by RideMe, 04-07-2024, 04:54 PM
      5 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X