PDA

View Full Version : Trap ExitOnClose


Rigsby66
06-13-2009, 10:47 AM
Hi

I have code that executes when I exit a trade (exit long or short). However, it doesn't execute if the trade is exited on ExitOnClose(). The same goes for a trade exiting at a stop loss.

My question is can I trap for the ExitOnClose()event happening and have my code run. The same goes for stop losses.?

I know that I could just create a scripted exit based on the time, but don't want to reinvent the wheel if I can simply trap for the event when it triggers.

Rigsby

NinjaTrader_Ben
06-14-2009, 01:13 AM
Hello,

Are you already using OnExecution?:
http://www.ninjatrader-support.com/HelpGuideV6/OnExecution.html

Rigsby66
06-15-2009, 10:50 AM
Hello,

Are you already using OnExecution?:
http://www.ninjatrader-support.com/HelpGuideV6/OnExecution.html


Cool, thanks for the tip...

I've just started with Ninja, and so haven't read all the documentation. I am also coming from a standard C and C++ background having never used C#, though it's very easy to follow and use (so far).

Also, I am not a trader... LOL, so am still trying to get my head round some of the lingo.

Cheers
Rigsby