PDA

View Full Version : BarsSinceExit()


dgregor5
08-06-2007, 11:09 AM
Hello

I am trying to implement something in the code which I thought would be somewhat simple, i.e.

if ('condition 1'
&& 'condition 2'
&& 'condition 3'
&& BarsSinceExit() > 0)

EnterShort()

Basically when entering the 'BarsSinceUpdate()' command I get zero orders executed.....removing this line & things go back to normal.


Clearly the code I have is a little more complicated than the above, but the principle is the same.

Any ideas as to where I could be going wrong?

thx
David

NinjaTrader_Dierk
08-06-2007, 11:22 AM
Unfortunately we are unable to review actual strategies for bandwidth reasons. NinjaScript consultants are available to help program your custom indicators/strategies or to help our users throughout their learning curve. Additional information is located here: http://www.ninjatrader.com/webnew/pa...injaScript.htm (http://www.ninjatrader.com/webnew/partners_onlinetrading_NinjaScript.htm)

Here is a quick hint:
As I "hit the wall" on some unexpected strategy behavior I usually try to isolate the cause of trouble by building a "simple as possible" variation of my strategy to see if that works as expected. As it does, I add condition by condition to locate where my logic (or the NT framework ?!?) breaks.

In your case I would start and try something like
Print (BarsSinceEntry())
to see if you get the results you would expect.

NinjaTrader_Josh
08-06-2007, 12:40 PM
Just a hunch. Maybe try BarsSinceExit() >= 1? That shouldn't make a difference though hmm. No errors in logs?