k+=2 is same as saying "Add 2 to the previous calculation of k.
ie if k is 0, then you have k+=2, then, the 2nd iteration of k will be 0 + 2.
3rd iteration of k will be 2 + 2 = 4;
4th k is 4 + 2 = 6;
Michael Charles Schefe #:
Thanks Michael. How about for my question 2 : the removal of the "case 1 (switch) + break" ? Would you be able to help ? Thanks
k+=2 is same as saying "Add 2 to the previous calculation of k.
ie if k is 0, then you have k+=2, then, the 2nd iteration of k will be 0 + 2.
3rd iteration of k will be 2 + 2 = 4;
4th k is 4 + 2 = 6;

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi coders, need your advice for codes.
I have a Multi-Symbols EA and for exit section, the codes are as follows :-
I think the Print Output above "Cs BUY AUDCHF (2025.04.14 14:13/Tkt 285304721) /ExitSigVal:+0+0+0+0+0-0-0-0-0-1/k:6/temCase:1 /ExitSequence:-0-0-0-1" should be able to enlighten you how the whole exit section works.
I have the following questions needing your advice and seeking your help :-
1) For the loop "for(int k=0; k<StringLen(ExitSequence); k+=2)", could you please explain how the "k+=2" works ? If you can provide some illustrations to explain would be the best. I'm a beginner, I can only understand k++ or k-- only.
2) In this exit section, it uses only one "case 1 (switch)", I think it is unnecessary / redundant. Could you please help me to modify the codes so that :-
a) No more "case 1 (switch) + break", i.e. to remove the relevant codes totally
b) Must keep the ExitSig(sym,cTkt,cOpTm,cOpPx,cLot,cTPPx,cSLPx) codes as it is required in other functions.
Finally, as long as [StringSubstr(ExitSequence,k,1)=="-"] finds any "-" in the ExitSequence, the OrderClose should close the BUY orders immediately. The codes must ensure that the relevant BUY order are confirmed has been closed only then stop looping the OrderClose.
Thank you.