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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X