Here is the code:
[SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]protected[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]override[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] Initialize() {[/SIZE]
[SIZE=1]TraceOrders = [/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1];[/SIZE]
[SIZE=1]Add([/SIZE][SIZE=1][COLOR=#2b91af][SIZE=1][COLOR=#2b91af]PeriodType[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1].Minute, 5);[/SIZE]
[SIZE=1]SetProfitTarget([/SIZE][SIZE=1][COLOR=#2b91af][SIZE=1][COLOR=#2b91af]CalculationMode[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1].Percent, 0.5);[/SIZE]
[SIZE=1]SetStopLoss([/SIZE][SIZE=1][COLOR=#2b91af][SIZE=1][COLOR=#2b91af]CalculationMode[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1].Percent, 0.1);[/SIZE]
[SIZE=1]ExitOnClose = [/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1];[/SIZE]
[SIZE=1]ExitOnCloseSeconds = 90;[/SIZE]
[SIZE=1]IncludeCommission = [/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]false[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1];[/SIZE]
[SIZE=1]Slippage = 0;[/SIZE]
[SIZE=1]TimeInForce = [/SIZE][SIZE=1][COLOR=#2b91af][SIZE=1][COLOR=#2b91af]TimeInForce[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1].Day;[/SIZE]
[SIZE=1]EntriesPerDirection = 1;[/SIZE]
[SIZE=1]EntryHandling = [/SIZE][SIZE=1][COLOR=#2b91af][SIZE=1][COLOR=#2b91af]EntryHandling[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1].UniqueEntries;[/SIZE]
[SIZE=1]BarsRequired = 15;[/SIZE]
[SIZE=1]CalculateOnBarClose = [/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1];[/SIZE]
[SIZE=1]}[/SIZE]
[SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]protected[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]override[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] OnBarUpdate() {[/SIZE]
[SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] (BarsInProgress == 1) {[/SIZE]
[SIZE=1][COLOR=#0000ff][SIZE=1][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] (ToDay(Time[0]) == 20080317 && ToTime(Time[0]) == 63000 && Volume[0] >= 10 * 50) {[/SIZE]
[SIZE=1]EnterLongLimit(10, 26.31, [/SIZE][SIZE=1][COLOR=#a31515][SIZE=1][COLOR=#a31515]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1]);[/SIZE]
[SIZE=1]}[/SIZE]
[SIZE=1]}[/SIZE]
[SIZE=1]}[/SIZE]
2/18/2010 10:33:06 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Percent Value=0.5 Currency=0 Simulated=False
2/18/2010 10:33:06 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Percent Value=0.1 Currency=0 Simulated=False
2/18/2010 10:33:06 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Percent Value=0.5 Currency=0 Simulated=False
2/18/2010 10:33:06 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Percent Value=0.1 Currency=0 Simulated=False
3/17/2008 6:30:00 AM Entered internal PlaceOrder() method at 3/17/2008 6:30:00 AM: Action=Buy OrderType=Limit Quantity=10 LimitPrice=26.31 StopPrice=0 SignalName='' FromEntrySignal=''
3/17/2008 6:30:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00002/Back101' Name='Profit target' State=Working Instrument='BSC' Action=Sell Limit price=39.47 Stop price=0 Quantity=10 Strategy='MyCustomStrategy' Type=Limit Tif=Day Oco='NT-00000' Filled=0 Fill price=0 Token='056896b3aa2a49479a7383a424dad26f' Gtd='12/1/2099 12:00:00 AM'
3/17/2008 6:30:00 AM Cancelled OCO paired order: BarsInProgress=1: Order='NT-00002/Back101' Name='Profit target' State=Cancelled Instrument='BSC' Action=Sell Limit price=39.47 Stop price=0 Quantity=10 Strategy='MyCustomStrategy' Type=Limit Tif=Day Oco='NT-00000' Filled=0 Fill price=0 Token='056896b3aa2a49479a7383a424dad26f' Gtd='12/1/2099 12:00:00 AM'
2/18/2010 10:33:07 AM Cancelled pending exit order, since associated position is closed: Order='NT-00002/Back101' Name='Profit target' State=Initialized Instrument='BSC' Action=Sell Limit price=39.47 Stop price=0 Quantity=10 Strategy='MyCustomStrategy' Type=Limit Tif=Day Oco='NT-00000' Filled=0 Fill price=0 Token='655985fc48404426b576197834152df9' Gtd='12/1/2099 12:00:00 AM'
2/18/2010 10:41:38 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Percent Value=0.5 Currency=0 Simulated=False
2/18/2010 10:41:38 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Percent Value=0.1 Currency=0 Simulated=False
The results of the strategy are:
- Entry Price = 26.31
- Exit Price = 3.18
- Entry time = 3/17/2008 6:35
- Exit time = 3/17/2008 6:35
- Profit = -0.8791
- Exit name = Stop loss
Thanks,
Erik

Comment