Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Comparing different time frames

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

    Comparing different time frames

    What's the best way to compare price action across different time frames when making a strategy? What I'd like to do is to check if a certain condition exists on a 15 minute or 1 hour time frame before entering a trade with further conditions set on the 1-5 minute time frame.

    Let's say I want to check if the 15 minute MACD set a new high within the last 24 hours. How do I check this value or any other time frame value? Is it done with a loop over the previous 24 hours at each BarUpdate()? Any help is appreciated.

    ----Edit---

    Figured I'd throw this in here too..if I want to leave a note at each trade during backtesting (such as, "entered based on X, exited based on Y") to interpret my chart results better, how would I do this? The chart displays "Sell/Buy at x price", so I'd like to write some text above or below that. I can't seem to find out how to do this.
    Last edited by gredenko; 09-29-2017, 08:45 PM.

    #2
    Hello gredenko,

    Thank you for your note.

    This would be possible.

    You would have to add an additinoal data series to the script,
    https://ninjatrader.com/support/help...dataseries.htm

    Here is an a link to our helpguide covering a script with multiple series,
    https://ninjatrader.com/support/help...nstruments.htm

    I have also attached a sample script which uses two SMA's both set to a different data series.

    To draw text on a specific bar you could use,
    https://ninjatrader.com/support/help...?draw_text.htm


    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_AlanP View Post
      Hello gredenko,

      Thank you for your note.

      This would be possible.

      You would have to add an additinoal data series to the script,
      https://ninjatrader.com/support/help...dataseries.htm

      Here is an a link to our helpguide covering a script with multiple series,
      https://ninjatrader.com/support/help...nstruments.htm

      I have also attached a sample script which uses two SMA's both set to a different data series.

      To draw text on a specific bar you could use,
      https://ninjatrader.com/support/help...?draw_text.htm


      Please let us know if you need further assistance.
      Thank you for the sample and for the guides! I will see how they work out.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by wushutrades, Today, 01:41 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by EvergreenGain, Yesterday, 10:56 PM
      0 responses
      9 views
      0 likes
      Last Post EvergreenGain  
      Started by Amedeus, Yesterday, 06:14 PM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by marktrading, Today, 12:32 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by Mijo Woo, Yesterday, 04:11 PM
      2 responses
      29 views
      0 likes
      Last Post Mijo Woo  
      Working...
      X