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, 07: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 wooofad, Today, 05:38 PM
      0 responses
      6 views
      0 likes
      Last Post wooofad
      by wooofad
       
      Started by caacapital, Today, 10:10 AM
      2 responses
      16 views
      0 likes
      Last Post caacapital  
      Started by DiverG20, Today, 10:23 AM
      0 responses
      22 views
      0 likes
      Last Post DiverG20  
      Started by SuneSorgenfrei, Today, 09:29 AM
      0 responses
      22 views
      0 likes
      Last Post SuneSorgenfrei  
      Started by dodoei, Today, 07:24 AM
      0 responses
      14 views
      0 likes
      Last Post dodoei
      by dodoei
       
      Working...
      X