Announcement

Collapse
No announcement yet.

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("Going Up" + CurrentBar, 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 Jeremytang, 07-14-2018, 06:45 PM
        21 responses
        439 views
        0 likes
        Last Post mav8rick  
        Started by LeonK, Yesterday, 09:26 PM
        1 response
        8 views
        0 likes
        Last Post bltdavid  
        Started by NicholasJoannette, Yesterday, 03:01 PM
        2 responses
        11 views
        0 likes
        Last Post NicholasJoannette  
        Started by rach1994, Yesterday, 12:20 PM
        1 response
        35 views
        0 likes
        Last Post bltdavid  
        Started by litamm89, Yesterday, 11:00 AM
        5 responses
        22 views
        1 like
        Last Post rafael_delima86  
        Working...
        X