My trading system in backtestoch works without problems, but the live trade is not working properly. I attach the log statement.
The system should specify two separate positions, and each has SetStopLoss and SetProfitTarget. The open position is seated correctly and = 2, but orders StopLoss and Profit Target as soon as the correct quantity = 1, and then are converted into quantity = 2
Seeing as follows:
BuyMarket = 1 (Long Position)
BuyMarket = 1 ((Long Position)
SellStop = 2 (stoploss)
SellStop = 2 (stoploss)
SellLimit = 2 (profittarget)
SellLimit = 2 (profittarget)
Can anyone advise me what is the problem? The real deals are made through GainCapital
Here is the log..
Here is the fragment code
{
if(BarsInProgress == 1)
return;
if ((CrossAbove(CCI(Cci), Bo_value, 1))......
{
EnterLong(Num_pos, "BuyLong1");
EnterLong(Num_pos, "BuyLong2");
SetProfitTarget("BuyLong1", CalculationMode.Ticks, TP1);
SetProfitTarget("BuyLong2", CalculationMode.Ticks, TP2);
SetStopLoss("BuyLong1", CalculationMode.Ticks, Sl, false);
SetStopLoss("BuyLong2" , CalculationMode.Ticks , Sl, false);
Print("TrendCCI03-BuyLong"+Instrument.MasterInstrument.Name);
}
Comment