PDA

View Full Version : Reference problem please help


skikg
12-28-2009, 09:50 AM
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
Bool goingUp = true;
in OnBarUpdate()
if(myema.UpLine [0] > myema.UpLine [1]) goingUp = true;
if(myema.UpLine [0] < myema.UpLine [1]) goingUp = false;
if (!goingUp)
{
DrawArrowDown("up arrow" + CurrentBar, true, 0, Low[0], Color.White);

}
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

NinjaTrader_Austin
12-28-2009, 09:55 AM
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:

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.

skikg
12-28-2009, 10:06 AM
Austin, Thanks for the help but nothing prints. I'm stumped

NinjaTrader_Austin
12-28-2009, 10:09 AM
That means the conditions for that code block are not evaluating to be true. Which, in your case, means goingUp is true.