Thanks a lot, Howard.
I've been reading the help, but I cannot find my mistake. Is very strange,
because the code is quite simple.
It is similar to this:
//------------------------------------
//SETTINGS--->
PosQty=Param("Posiciones",10,1,20,1);
SetOption("InitialEquity", 1000000 );
SetOption("AllowPositionShrinking", True );
SetOption("MaxOpenPositions", PosQty );
SetOption ("accountmargin",100);
PositionSize = -100/(posqty);
//-----------
SetTradeDelays(1,1,1,1);//buy after signal
ApplyStop(stopTypeProfit, stopModePercent,2, 1);//exit intraday on same bar at
2%
/CONDITIONS---------------------------------------
Cond1=Cross(MACD(12,26),0);
//long entry-----------------------------
PositionScore= 100-StochK(15,3);
Buy= Cond1;
BuyPrice=Open*1.001;//in open next bar!
Sell=Cross(Signal(12,26,9),MACD(12,26));//sell in open next bar
SellPrice=Open*0.999;
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy);
//------------END OF CODE------------------
It is really simple. Well, the problem is that the profit loss, many times
(nearly always) triggers, at 2.3%, 2.4%, 2.5%. Very strange, it should be at 2%
or very close.
I thought that this logic means that should never have a profit-sell more than
2%, if it is sold in the same bar as bought, isn't it?
Well, the backtest sells many times in the same bar as buy, with a much more
profit than 2%... ?¿¿¿
And also, I have sometimes big profits in later bars, although that could be if
sold at the open..
It's incredible, I can not even guess the mistake..
I don't know what to do, at the moment.
I'll post if I discover my error, it must be a silly thing..
greetings