Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 274
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
write a script and after each statement display the information + GetLastError() with Alert() - see example script above
How can I do this if I have an error in my code? Alert() won't help me if the script won't work!
throw out everything but the first line of the script and add Alert. Then add it gradually - learn how to program and debug
That was quick. How will you search for bars? In a loop or using the time structure?
EUR USD
drop everything from the script except the first line and add Alert. Then add it gradually - you will learn how to program and debug
if (OrderSelect(1,SELECT_BY_POS,MODE_HISTORY))
int tip=OrderType();
Af ternoon. I need help, I need to close sell order and then the next order can only be open buy, I want to use order history to find the last closed order and know its type, but I can not do it (who knows what I'm doing wrong, tell me) if I don't know the answer, which would help me to make the code work, please do not write!
int 1 = OrdersHistoryTotal();
if (OrderSelect(1,SELECT_BY_POS,MODE_HISTORY))
int tip=OrderType();
Af ternoon. I need help, I need to close sell order and then the next order can only be open buy, I want to use order history to find the last closed order and know its type, but I can not do it (who knows what I'm doing wrong, tell me) if I don't know the answer, which would help me to make the code work, please do not write!
Good evening, below is the code, I wrote a ticks counter, my idea is that the ticks are counted on every bar in the loop, on every new bar the counter is reset, when I start the indicator it says in the comments that on the previous bar 1 tick and the current ticks starts counting from
If I try to use a different magic sprite, I don't know why I tried to use it but I don't know why I tried to use it. Maybe I wrote it wrong?
Good evening, below is the code, I wrote a ticks counter, my idea is that the ticks are counted on every bar in the loop, on every new bar the counter is reset, when I start the indicator it says in the comments that on the previous bar 1 tick and the current ticks starts counting from
If I try to use a different magic sprite, I don't know why I tried to use it but I don't know why I tried to use it. Maybe I wrote it wrong?
If I understand the problem and question correctly, the ticks are not saved on the history. Take a look at my indicator.
If I understood the problem and the question correctly, it doesn't save ticks on history. See my indicator.
The link doesn't work, it says no page
Good evening, below is the code, I wrote a ticks counter, my idea is that the ticks are counted on every bar in the loop, on every new bar the counter is reset, when I start the indicator it says in the comments that on the previous bar 1 tick and the current ticks starts counting from
If I try to use a different magic sprite, I don't know why I tried to use it but I don't know why I tried to use it. Maybe I wrote it wrong?
return rates_total-1 or 0