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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      672 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      379 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      111 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      582 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X