how can i count the history total loss and total profit
0 replies
most mos
7 years ago #240564
how can i count the history total loss and total profit
i will use them for many things
here is a code i made and still cant identify the total loss and total profit thanks for the help and sorry if i added my question in the wrong forum i am new
void OnTick()
{double ma1,ma2,ma3,ma4,ma5,ma6;
double SL,TP;
ma1=iMA(NULL,0,15,0,MODE_SMA,PRICE_CLOSE,1);
ma2=iMA(NULL,0,15,0,MODE_SMA,PRICE_CLOSE,2);
ma3=iMA(NULL,0,30,0,MODE_SMA,PRICE_CLOSE,1);
ma4=iMA(NULL,0,15,0,MODE_SMA,PRICE_CLOSE,0);
double Speed=MathAbs(ma3-Close[0])/Point;
Comment(Speed);
double speed2=Speed+400;
if(ma1>ma3&&ma1>ma2&&Close[2]>ma1&&Close[1]>ma1&&Close[0]<=ma4&&Close[0]>ma3&&orderstotal()<max)
{
SL=Ask-speed2*Point;
TP=Ask+speed2*Point;
OrderSend(Symbol(),OP_BUY,lots,Ask,3,SL,TP,”klk”,MagicNumber,0,Blue);
}
0