Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with MTF Strategy

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

    Help with MTF Strategy

    Hi support,
    I've been using MTF strategies for a while, but I am unable to overcome a problem.

    In my strategy I use 2 time frames:
    primary time frame, lets say 60 min = BarsArray[0]
    secondary time frame, lets say 1 min = BarsArray[1]

    I am using this script:

    Code:
    if(BarsInProgress == 1)
    {
    myHigh = Math.Max(Highs[0][0], MAX(Highs[1],60)[0]);
    }
    with this code I would expect that myHigh = the highest between the previous 60min bar high and the most recent high, intended as a higher high printed on the 1 min bar. However when running this script if will always and only return the last 60 min bar, as if in all the sample data i run never a higher high of the previous high is printed.

    FOR EXAMPLE, lets say that during the last 60 min period ended at 10.00am the high was 1.6015 (Highs[0][0] == 1.6015), now lets say that at 10.15am a new high at 1.6016 is done, therefore Highs[1][0] == 1.6016 on the next 1 min bar, I would exect myHigh to be equal to 1.6016 at 10.16am, but this doesn't currently happen

    How is this possible? what am I doing wrong?

    Thanks,
    Last edited by sburtt; 11-24-2013, 11:47 AM.

    #2
    Originally posted by sburtt View Post
    Hi support,
    I've been using MTF strategies for a while, but I am unable to overcome a problem.

    In my strategy I use 2 time frames:
    primary time frame, lets say 60 min = BarsArray[0]
    secondary time frame, lets say 1 min = BarsArray[1]

    I am using this script:

    Code:
    if(BarsInProgress == 1)
    {
    myHigh = Math.Max(Highs[0][0], MAX(Highs[1],60)[0]);
    }
    with this code I would expect that myHigh = the highest between the previous 60min bar high and the most recent high, intended as a higher high printed on the 1 min bar. However when running this script if will always and only return the last 60 min bar, as if in all the sample data i run never a higher high of the previous high is printed.

    FOR EXAMPLE, lets say that during the last 60 min period ended at 10.00am the high was 1.6015 (Highs[0][0] == 1.6015), now lets say that at 10.15am a new high at 1.6016 is done, therefore Highs[1][0] == 1.6016 on the next 1 min bar, I would exect myHigh to be equal to 1.6016 at 10.16am, but this doesn't currently happen

    How is this possible? what am I doing wrong?

    Thanks,
    • How many days of data do you have on the chart?
    • I presume that you do have a CurrentBars check for both Price DataSeries?
    • What is your BarsRequired?

    Comment


      #3
      Originally posted by koganam View Post
      • How many days of data do you have on the chart?
      • I presume that you do have a CurrentBars check for both Price DataSeries?
      • What is your BarsRequired?
      Thanks, I've actually overcome the issue. This is part of a more complex script and i was missing a check. Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      63 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      54 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      61 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Working...
      X