Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 rhyminkevin, Today, 04:58 PM
        1 response
        42 views
        0 likes
        Last Post Anfedport  
        Started by iceman2018, Today, 05:07 PM
        0 responses
        5 views
        0 likes
        Last Post iceman2018  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        7 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        49 views
        0 likes
        Last Post futtrader  
        Working...
        X