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 sjsj2732, Yesterday, 04:31 AM
        0 responses
        35 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        287 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        286 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        133 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        92 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X