I manage to get normal lot exponent but I need to change it a bit by grouping example in the picture. Can someone guide me how to get the lot exponent but with a grouping technique Group=5 Exponent=1.8?
double GroupExponent(int type)
{
double lot=0,exponent=1.8,group=5,initialLot=0.01;
if(type==OP_SELL)
............. //<---- Do i need to loop this area ?
lot= initialLot * MathPow(exponent,TotalSell());
return lot;
}
int TotalSell()
{
int Sell=0;
for(int trade=OrdersTotal()-1; trade>=0; trade--)
{
if(!OrderSelect(trade,SELECT_BY_POS,MODE_TRADES))continue;
if(OrderSymbol()==Symbol() && OrderType()==OP_SELL))
Sell++;
}
return Sell;
}