Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MRO on different timeframe

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

    MRO on different timeframe

    Good evening,

    Being that the MRO function does not work on multi time frames is there any work around? I am looking to find the most recent occurrence of Highs[1][0] > Highs[1][1] in the last 10 bars.

    Any help would be greatly appreciated.

    Thanks,
    Ryan

    #2
    Hello Ryan,

    Thank you for your note.

    Although you wouldn't be able to use MRO in your multi-time frame script, you could still add some logic that would find how many bars ago the condition occurred by using a loop. Here is an example of what this could look like, which is a little different from MRO because it will start from 10 bars ago and work its way forward:

    if (BarsInProgress == 1)
    {
    myMROValue = -1;

    for (int x = 10; x >= 0; x--)
    {
    if (High[x] > High[x+1])
    myMROValue = x;
    }
    Print(CurrentBars[1] + " " + myMROValue);
    }

    You may need to tweak it to get it to work exactly how you'd like it, though this is the idea to loop through and find the barsAgo index for when Highs[1][0] > Highs[1][1] was true most recently.

    Please let us know if we may be of further assistance.​

    Comment


      #3
      Emily, that is just what I needed. Thank you very much.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      177 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      331 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      254 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      356 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      184 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X