Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieving the High/Lows of a Previous Move

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

    Retrieving the High/Lows of a Previous Move

    I'm hoping that there is a simpler way of retrieving the High/Lows of a move. As an example use a simple MA CrossOver. I want to be able to retrieve the the High and Low of the last time the MA was in Up mode even though the MA's have crossed into down mode. The next time the MA's go into Up mode I can retrieve the High/Low from the previous Up mode.

    I have written this before in EsignalScript (EFS uses Java) and really don't want to have to recreate it in C#.

    So here is hoping that there is a simple combination of commands!!!!!

    HELP. PLEASE.

    TJ

    #2
    Check out the MRO function.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Mro

      OK I have been working with the MRO command but not having much luck.

      I am trying to determine the number of bars ago that the EMA10 CrossedAbove the EMA20. Am using 100 bars to look back. What is wrong with the following code?

      int barsAgo = MRO(delegate {return CrossAbove(EMA(10), EMA(20), 100);}, 100, 1);
      if (barsAgo > -1)
      Print("The last EMA CrossAbove was " + barsAgo + " Bars Ago");






      Originally posted by Josh View Post

      Comment


        #4
        Try this
        Code:
        int barsAgo = MRO(delegate {return CrossAbove(EMA(10), EMA(20), 1);}, 100, 1);
        The MRO function should do the 100 bar lookback. I don't think you need the CrossAbove to lookback 100 also.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        161 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        310 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        245 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        349 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X