Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reference problem please help

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

    Reference problem please help

    I made a trend ema that has two plotstyle properties. UpLine (for when the ema is trending up) and DnLine (for when the ema is trending down)
    The indicator works fine however when I call upon it in a new indicator nothing happens.
    I did a basic test with the one condition and still nothing.
    Here is the test.

    in variables
    Code:
        Bool goingUp = true;
    in OnBarUpdate()
    Code:
        [COLOR=blue][FONT=&quot]if[/FONT][/COLOR](myema.UpLine [0] > myema.UpLine [1]) goingUp = true;
      [COLOR=blue][FONT=&quot]if[/FONT][/COLOR](myema.UpLine [0] < myema.UpLine [1]) goingUp = false;
      [COLOR=blue][FONT=&quot]if[/FONT][/COLOR][COLOR=black][FONT=&quot] (!goingUp)[/FONT][/COLOR]
      [COLOR=black][FONT=&quot]            {[/FONT][/COLOR]
      [COLOR=black][FONT=&quot]                DrawArrowDown([/FONT][/COLOR][COLOR=maroon][FONT=&quot]"up arrow"[/FONT][/COLOR][COLOR=black][FONT=&quot] + CurrentBar, [/FONT][/COLOR][COLOR=blue][FONT=&quot]true[/FONT][/COLOR][COLOR=black][FONT=&quot], [/FONT][/COLOR][COLOR=purple][FONT=&quot]0[/FONT][/COLOR][COLOR=black][FONT=&quot], Low[[/FONT][/COLOR][COLOR=purple][FONT=&quot]0[/FONT][/COLOR][COLOR=black][FONT=&quot]], Color.White);[/FONT][/COLOR]
      
      [COLOR=black][FONT=&quot]            }[/FONT][/COLOR]
    I can change the UpLine Value to the DnLine value or even go with the overall myemaVal and still I get nothing.

    This boggles my mind in the data output box everything shows up fine. UpLine and DnLine Values.

    Has anyone had this problem before? If so can you please steer me in the right direction.


    Thanks, Kyle

    #2
    Kyle, are you sure the statement is executing? You can try adding Print() statements to code blocks to make sure everything is running as expected:
    Code:
    if (!goingUp)
    {
    Print("goingUp is false. drawing arrow.");
    DrawArrowDown("up arrow" + CurrentBar, true, 0, Low[0], Color.White);
    }
    Then you can open up the output window (Tools -> output window) and view the print statements to verify everything is working like it should.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin, Thanks for the help but nothing prints. I'm stumped

      Comment


        #4
        That means the conditions for that code block are not evaluating to be true. Which, in your case, means goingUp is true.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        550 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X