Jump to content

Recommended Posts

Posted

hi, not sure if am at the wright place to post my question, but i go, is there any other ways to write this expression in working mql4 code, i try to explain my strategy without taking 100 page to explain only one parameter in my ea. So the expression is: (serve to analyse the 104 last order closed) want to do the same for the last 103,102,101, ... and 4 last orders closed) expression =

(A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*A1*B1*C1*D1*E1*F1*G1*H1*I1*J1*K1*L1*M1*N1*O1*P1*Q1*R1*S1*T1*U1*V1*W1*X1*Y1*Z1*A2*B2*C2*D2*E2*F2*G2*H2*I2*J2*K2*L2*M2*N2*O2*P2*Q2*R2*S2*T2*U2*V2*W2*X2*Y2*Z2*A3*B3*C3*D3*E3*F3*G3*H3*I3*J3*K3*L3*M3*N3*O3*P3*Q3*R3*S3*T3*U3*V3*W3*X3*Y3*Z3) >0 && (A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+A1+B1+C1+D1*E1+F1+G1+H1+I1+J1+K1+L1+M1+N1+O1+P1+Q1+R1+S1+T1+U1+V1+W1+X1+Y1+Z1+A2+B2+C2+D2+E2+F2+G2+H2+I2+J2+K2+L2+M2+N2+O2+P2+Q2+R2+S2+T2+U2+V2+W2+X2+Y2+Z2+A3+B3+C3+D3+E3+F3+G3+H3+I3+J3+K3+L3+M3+N3+O3+P3+Q3+R3+S3+T3+U3+V3+W3+X3+Y3+Z3)>0

 

if 2 expression = false (mean do x thing)

if 2 expression = true (mean do y thing)

 

so i want to add 100 time this kind of expression in my ea just to check the current level reach.

Thanx in advance.

Posted (edited)

you can use two nested for loops

 

for(int k=104; k>=4; k--)

{

exp1=0; exp2=0;

 

for(int i= 0 i<k; i++)

{

//calculate expression 1 and 2 by running through the OrderHistory

exp1*=x; //maybe OrderProfit or somthing like this

exp2+=y

}

//evaluate exp1+2

if(exp1>0 && exp2>0)

.......

}

Edited by iwjw

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...