[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 611
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
please advise...what the hell...in its original form (withoutPlaySound("alert.wav");) - works. But if you add to any link in addition to the destination flag and some action (play music for example) ... then the flags are printing 0000 and the music is played at full speed! Please tell me where the error?
Why are you comparing the same thing so many times in a row?
if(Stoch_1>Stoch_2) { flag1=1 ; Print (flag1,flag2,flag3,flag4); }
if(Stoch_1<Stoch_2 && flag1==1) flag2=1 ; Print (flag1,flag2,flag3,flag4); }
if ((Stoch_1>Stoch_2) && flag1==1 && flag2==1) {flag3=1; Print (flag1,flag2,flag3,flag4);PlaySound("alert.wav");}
if(Stoch_1<Stoch_2 && flag1==1 && flag2==1 && flag3==1) flag4=1;
{Print (flag1,flag2,flag3,flag4);}
if(Stoch_1>Stoch_2 && flag1==1 && flag2==1 && flag3==1 && flag4==1)
{OrderSend (Symbol( ), OP_SELL, 0.01 ,Bid, 0, 0, 0, NULL, 450, 0, CLR_NONE);
Print ("OUT");}
flag1=0;
flag2=0;
flag3=0;
flag4=0;
Understanding that you'll learn and for the sake of learning you write something... At least I've arranged your brackets in such a way that they play a role, in my opinion.
Good afternoon! Please help me with order modification, i.e. the order selection cycle for its condition. I first find an order triggered at TakeProfit, it is a specific order with a tacket ticket. Thus, the loop fails about once out of ten, which is indicated by the difference of green and blue lines in the tester. And visualization - stop loss sometimes does not move.
In general, help, please!
Condition
1.Executed if there are no orders in the terminal history and it does not make sense to continue the cycle in that case.
Thank you!!! That's where it's all going down. That's the problem!!! How did he even modify himself once in a while?
2. To find an order triggered exactly at Take Profit, we should compare the TP value with the close price of the order
I first select a certain order in the loop on the history and then I seem to compare it that way.
if (!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue; In my loop, it is like this - if there are no orders in the terminal history, and it makes no sense to continue the loop in that case, then continue!
So it's like this, isn't it?
Wow, a riddle!!!
1.Executed if there are no orders in the terminal history and it does not make sense to continue the cycle in that case.
Thank you!!! That's where it's all going down. Oh my gosh! How did he even modify himself once in a while?
2. To find an order triggered exactly at Take Profit, we should compare the TP value with the close price of the order
I first select a certain order in the loop on the history and then I seem to compare it that way.
If a specific order, i.e. you know the ticket number, you don't need a cycle, just selectOrderSelect(ticket,SELECT_BY_TICKET, MODE_HISTORY)
if (!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue; In my loop it is like this - if there are no orders in the term history, and it makes no sense to continue the loop in that case, then continue!
So it's like this, isn't it?
Wow, a riddle!!!
Thenbreak orreturn.continue; -- the cycle continuation operator.