|06-24-2008, 10:08 PM||#1|
Join Date: Feb 2008
Thanked 0 times in 0 posts
How to use SetStopLoss with pecentage?
I used SetStopLoss with the ticks mode in my strategy and it worked in backtesting e-mini future contracts.
However, when I change to either price or percentage mode, the stop loss order did not seem to be placed.
Does the price or percentage mode work for future contracts? I must add that I enter at the same timeframe but exit at a longer timeframe:
From 1 min:
EnterShort(0, firstHalf, "FirstHalf");
From 15 min:
ExitShort(0, firstHalf, "ExitFirstHalf", "FirstHalf");
Seperately, if I enter two orders for scaling out, should I call SetStopLoss once without specifying the signal name or call it twice:
SetStopLoss("FirstHalf", CalculationMode.Price, 1321, false);
SetStopLoss("SecondHalf", CalculationMode.Price, 1321, false);
Last edited by ooppie; 06-24-2008 at 10:26 PM.
|06-24-2008, 10:29 PM||#2|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Thanked 107 times in 70 posts
For scaling out this reference sample may be of use: http://www.ninjatrader-support.com/v...ead.php?t=3751
In terms of CalculationModes they should all work. Please see the Control Center logs for any messages. Also please use TraceOrders = true to debug the orders. I suspect maybe they are getting cancelled via invalid stop price? TraceOrders will tell you in the Output Window if this is the case.
NinjaTrader Customer Service
|Thread||Thread Starter||Forum||Replies||Last Post|
|SetStopLoss Question...||fxRichard||Automated Trading||3||06-02-2008 04:50 PM|
|SetStopLoss||thepcmd||Strategy Development||2||12-01-2007 01:14 PM|
|SetStopLoss() and SetProfitTarget()||SamIam||Strategy Development||9||09-05-2007 08:49 PM|
|SetStopLoss Question||aethelwulf||General Programming||3||07-03-2007 04:00 PM|
|setstoploss order from TS 8.1||ppreal||Automated Trading||15||12-20-2006 07:46 AM|