PDA

View Full Version : Example of Auto Breakeven code?


Thomas
08-16-2007, 08:11 PM
1) I have the settings for my stop loss and targets as

SetStopLoss("", CalculationMode.Ticks, 12, false);
SetProfitTarget("", CalculationMode.Ticks, 12);

I can't seem to find the code to insert auto break even?

ie: go to breakeven after profit reaches 8 ticks.

Any help would be appreciated.

-------------------------------------------------------------------

2) During the backtesting process, when I insert times for my strategy to operate, I don't get any signals. When I remove the code
ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 1559
I then get the backtesting results? What am I doing wrong here?

Thanks in advance for any direction on these two matters.

NinjaTrader_Dierk
08-17-2007, 12:10 AM
1) Unfortunately AutoBreakEven is not support on NinjaScript strategies only.
2) I suggest adding Print() statements to your logic to see where it breaks.

Thomas
08-17-2007, 01:29 PM
[quote=NinjaTrader_Dierk;14474]1) Unfortunately AutoBreakEven is not support on NinjaScript strategies only.
quote]

1) Will auto break-even be an option on "NS strategies only", in the near future?

2) Do I need to program in an ATM custom to get an auto break-even aspect to the strategy?

3) If so, can I combine the custom ATM with other NS exit/profit target strategies? For simplistic sake, could I have a custom ATM and a simple "cross above..." strategy as the exits. If any exit is filled then all orders would be cancelled?

Thanks in advance for your response.

NinjaTrader_Ray
08-17-2007, 02:32 PM
1) No however, we will provide sample code to accomplish breakeven

2) No, you can program this with NinjaScript right now. We will have some reference samples available soon.

3) No you can not.

Thomas
08-17-2007, 03:39 PM
Thanks for your reply...I'll be looking forward to all of the new reference samples.