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

Checking that a condition occurred during session

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

    Checking that a condition occurred during session

    Hello,

    For example, I want see if the price, anytime during the current session, was below some moving average.

    I was thinking about using the MRO, but I run on Range bars, so not sure how to see if most recent occurence was less than some time back.

    Am I on the right track here?

    #2
    Hello coolmoss,
    Thanks for writing in and I am happy to assist you.

    Please you this code to check if price was below SMA(14)
    Code:
    int i = MRO(delegate{return Close[0] < SMA(14)[0];}, 1, Bars.BarsSinceSession);
    You might want to replace Close[0] with Low[0] in case SMA has been above low but below close.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Man, you guys are simply awesome. To get answers so freakin fast just makes my day a whole lot more enjoyable.

      Wish I could buy 'ya all a round!

      Comment


        #4
        Hello coolmoss,
        Glad your issue was resolved.
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by gentlebenthebear, Today, 01:30 AM
        2 responses
        13 views
        0 likes
        Last Post gentlebenthebear  
        Started by Kaledus, Today, 01:29 PM
        2 responses
        8 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by frankthearm, Yesterday, 09:08 AM
        13 responses
        45 views
        0 likes
        Last Post frankthearm  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        16 views
        0 likes
        Last Post PaulMohn  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        2 responses
        56 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Working...
        X