I wonder if someone can help
I am trying to add a step function to the lotsize variable in the basic bones ea
the idea being on each losing trade the step multiplier increase by 1 and on a winning trade it reverts back to 1.
so simply on 3 losses the step multiplier would be 0.3 (starting at 0.1) if the 4th trade is a winner then we are back to step = 1 ie back to 0.1 lotsize.
so in the bones ea i added
Code: Select all
int step=1;
for (int cc = 0; cc <= OrdersHistoryTotal(); cc++)
{
if (!OrderSelect(cc, SELECT_BY_POS, MODE_HISTORY) ) continue;
if (OrderSymbol() != Symbol() ) continue;
if (OrderMagicNumber() != MagicNumber) continue;
OverallProfit+= (OrderProfit() + OrderSwap() + OrderCommission() );
if (OrderProfit() > 0) WinTrades++;
if (OrderProfit() < 0) LossTrades++;
if (OrderProfit() > 0) step=1;
if (OrderProfit() < 0) step++;
GlobalVariableSet("step"+Symbol(),step);
}//for (int cc = 0; cc <= tot -1; cc++)
step=GlobalVariableGet("step"+Symbol());
//lotsize=lotsize*step;
bool SendSingleTrade(string symbol,int type,string comment, double lotsize,double price,double stop,double take)
{
//..........etc
any help gratefully recieved
thank you