PDA

View Full Version : Flatten strategy position at start


wittyscreenname
12-31-2008, 10:46 AM
I'm pretty new to NT and am working on my first fully automated ninjascript. It's working just fine except for when I start my strategy up, I have to wait for the strategy position to flatten before it will trade live. I read all the threads and the help file about the difference between strategy and account positions... I get all that.

My question: is there is a way to manually flatten the strategy position when my script starts up? Phrased another way... is there a way to restrict the script from analyzing the past on startup?

I just want my strategy to start flat every time. Is there a way to do this?

Thanks so much. Nice product and great forum help.

Dave

NinjaTrader_Josh
12-31-2008, 10:50 AM
Hi Dave,

Add this to the top of OnBarUpdate():
if (Historical)
return;

wittyscreenname
12-31-2008, 10:53 AM
Righteous! Works perfectly!

Thank you so much...