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 FrancisMorro, Today, 03:24 AM
        0 responses
        1 view
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,770 views
        0 likes
        Last Post Leafcutter  
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        31 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        944 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        11 views
        0 likes
        Last Post Max238
        by Max238
         
        Working...
        X