Show the code that you have tried and maybe somebody can assist, use the code button (Alt+S) when pasting code.
Is this for MQL4 or 5 ?
Show the code that you have tried and maybe somebody can assist, use the code button (Alt+S) when pasting code.
Is this for MQL4 or 5 ?
i updated the trend
its MQL4
thanks
i updated the trend
its MQL4
What does " i updated the trend " mean?
I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
What does " i updated the trend " mean?
I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
thanks
i appreciate that
what i meant by have updated the trend is that i attached my code as you have suggested earlier on
hello
am working on a counter that increases only, when trade picked, and reset back only when OrdersTotal()==0
i.e counter should be 5 if i have 5 opened trades and should remain at 5 if 1 or more trades are closed.
if i have 10 opened orders counter should read 10 and if 5 were closed counter should remain at 10 and if 2 more trades were opened counter should be at 12 (despite total orders are 7) and reset back to 0 (zero) when i have no opened orders
i tried some some functions but not working it reduces when some orders were closed, Here is a function for SELL orders only
thanks
I think that you are going about it the wrong way.
You should have a globalscope or static variable to count the trades and set it to 0 initially (or the value of OrdersTotal()).
Whenever a new trade is opened increase the counter by 1.
If OrdersTotal()==0 reset it to 0.
I think that you are going about it the wrong way.
You should have a globalscope or static variable to count the trades and set it to 0 initially (or the value of OrdersTotal()).
Whenever a new trade is opened increase the counter by 1.
If OrdersTotal()==0 reset it to 0.
it reduces whenever some trades were closed, but i need it to retain its value
I think that you are going about it the wrong way.
You should have a globalscope or static variable to count the trades and set it to 0 initially (or the value of OrdersTotal()).
Whenever a new trade is opened increase the counter by 1.
If OrdersTotal()==0 reset it to 0.
it reduces whenever some trades were closed, but i need it to retain its value
Read carefully and concentrate on what I have written. If you follow the logic the value will not reduce unless there are no open orders.
Read carefully and concentrate on what I have written. If you follow the logic the value will not reduce unless there are no open orders.
could you please explain better ?
could you please explain better ?
I think that it is totally clear. I don't know how I could explain it better.
I think that it is totally clear. I don't know how I could explain it better.
but its not working,
no Problem thanks for the reply, i will continue trying

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello
am working on a counter that increases only, when trade picked, and reset back only when OrdersTotal()==0
i.e counter should be 5 if i have 5 opened trades and should remain at 5 if 1 or more trades are closed.
if i have 10 opened orders counter should read 10 and if 5 were closed counter should remain at 10 and if 2 more trades were opened counter should be at 12 (despite total orders are 7) and reset back to 0 (zero) when i have no opened orders
i tried some some functions but not working it reduces when some orders were closed, Here is a function for SELL orders only
thanks