[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 612
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
So why are you comparing the same thing a bunch of times in a row?
Well, how do you think it should be compared?
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.
and even though your code gave out 24 errors in the compiler!!! still thanks even for the sloppy help.... for the idea... (it works now - although I tried to do it that way in principle, but the punctuation was a problem)
Again I wondered what the position index is. If it is a position number in the history, then what does this function do?
GetIndexLastPos Index of the last opened position or -1 ???
the index of the last opened position is always 1 because it is the latest !!!
i am obviously misunderstanding the INDEX ....
clue who knows ?
How do you think it should compare?
Let's begin:
1.If(Stoch_1>Stoch_2) flag1=1 ; , then the condition following it (Stoch_1<Stoch_2 && flag1==1) cannot in principle be true, because if Stoch_1<Stoch_2 flag1==0 and if flag1==1then Stoch_1>Stoch_2. it is the same with all subsequent conditions in this function, so only flag1 can change the value. That is, your program will execute the first two lines, skipthe third, executethe fourth, skipthe fifth, execute the sixth, execute the seventh, and skip all others.
TarasBY,
Var1 and others named as I have, inserted block fGet_MineGV() inside init and block fSave_MineGV() inside staft.
When compiling, the EA gave out a bunch of errors.
I tried it one by one. First I inserted it inside init, then compiled it. There are 0 errors, one remark: is not referenced and will be removed from exp-file. Well, it makes sense to me, it can't find the file, because it doesn't exist yet. It has to be written inside the staft.
So, when I try to write the second block inside the staft, it produces a lot of errors.
Structural algorithm:
Did you, of course, do that??? And it doesn't compile???
Again I wondered what the position index is. If it is a position number in the history, then what does this function do?
GetIndexLastPos Index of the last opened position or -1 ???
the index of the last opened position is always 1 because it is the latest !!!
i am obviously misunderstanding the INDEX ....
clue who knows ?
the index of the last opened is always 1 because it's the latest !!! Not 1, but 0, and not in the history. In the history 0 is the index of the last closed position or of the last deleted order, and not always, because besides the market, there are also pending orders, which are not positions.
Prof Profi, please tell me how to write the following programmatically: "To put a pending order at SL level with parameters of a closing order including spread" and where to attach it in the EA code?
You can't do it with parameters of a close order. The opening price is also a parameter.
TarasBY
Yes, I did as you wrote. And it doesn't compile.
Obviously, I've done something wrong, but I don't know what exactly. You can go through it step by step.
There is no way with the parameters of the one to be closed. The opening price is also a parameter.