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 RookieTrader, Today, 09:37 AM
        2 responses
        10 views
        0 likes
        Last Post RookieTrader  
        Started by alifarahani, Today, 09:40 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Gerik, Today, 09:40 AM
        2 responses
        6 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Started by KennyK, 05-29-2017, 02:02 AM
        3 responses
        1,285 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by AttiM, 02-14-2024, 05:20 PM
        11 responses
        186 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X