PDA

View Full Version : Can Ninjascript identify when there is a missing collar?


sev888
07-16-2010, 11:46 PM
We are trying to design our automated system to act accordingly when problems arise during it's trading. Our Ninjascripted automated strategy is set up to always have a collar on (stop loss and profit target) whenever it has an open order. But since such a collar is located on the local trading machine, if ever the local machine freezes or loses power, then the strategy loses its collar. Can you suggest any Ninjascript code that can identify when either leg of such a collar is missing? such that we can then instruct the automated strategy to 'flatten all' in such worst case scenarios?

Thank you for your time and suggestions..

mrlogik
07-17-2010, 06:56 AM
sev,

I believe when you use the SetStopLoss() or SetProfitTarget function calls with the "simulated" parameter set to false, the orders will sit on the broker server rather than your machine. By doing this, you should achieve the safety protection you're looking for.