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

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 zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X