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

How to turn off MRO

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

    How to turn off MRO

    Hello,
    The title of my post is not exactly accurate. What I'm trying to do is print a dot every time my code is true. Instead I'm getting the most recent occurrence. Can someone look at my code to show me what I need to add? Thanks.
    Code:
    if (RSChannel(9, 1.5, 3, 14, 10).Mid[0] > VMAZones(9, 2, 18).Upper[0]
                    && RValueCharts(Color.Blue, 3, 5).VClose[0] > 4)
                {
                    DrawDot("Going Up", true, 0, High[0] + .5, Color.DarkGreen);
                }
       if (RSChannel(9, 1.5, 3, 14, 10).Mid[0] < VMAZones(9, 2, 18).Lower[0]
                    && RValueCharts(Color.Blue, 3, 5).VClose[0] < -4)
                {
                    DrawDot("Going Down", true, 0, Low[0] -.5, Color.DarkRed);
                }

    #2
    Hello CaptainAmericaXX,
    If you modify the code as shown below then are you getting the correct scenario.

    Code:
    DrawDot([B]"Going Up" + CurrentBar[/B], true, 0, High[0] + .5, Color.DarkGreen);
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      That did it. Thank you Joydeep. Can you explain why adding "Current Bar" to the string allows the dot to print on every occurance?

      Comment


        #4
        Hello CaptainAmericaXX,
        Each draw object are identifiable with a tag value. You were using a tag value ("Going Up") which is same for every bar and thus it was getting overwritten everytime the condition was true. Adding the "CurrentBar" to the tag value makes it unique for for each bar.

        Thus if your condition was true in bar 10 and bar 50, then the tag value will be appended as
        "Going Up10" and "Going Up50" which are unique and will not be overwritten.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        21 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Working...
        X