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 mgco4you, Today, 09:46 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        3 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        6 views
        0 likes
        Last Post Rapine Heihei  
        Started by f.saeidi, Today, 08:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X