i need help please. im trying to prevent the ea from making multiple trades at the same time. i have tried it with a for loop but had no luck.can someone please help me to solve the problem. my code look like this. its the buy section
- 1 new trade per new candle on EA mql4. How?
- change time frame
- Prevention of repeat trade in same direction within a bar
Niel05otto:
i need help please. im trying to prevent the ea from making multiple trades at the same time. i have tried it with a for loop but had no luck.can someone please help me to solve the problem. my code look like this. its the buy section
i need help please. im trying to prevent the ea from making multiple trades at the same time. i have tried it with a for loop but had no luck.can someone please help me to solve the problem. my code look like this. its the buy section
There is many ways to limit 1 trade to open. I urge you to look in codebase for many eas with many examples.
Thank you Michael. I've been searching on Google and could not find exactly what I need but did found one article where they use a for loop but mine doesn't work. Could you maybe shere a link of a video please
Niel05otto #:
Thank you Michael. I've been searching on Google and could not find exactly what I need but did found one article where they use a for loop but mine doesn't work. Could you maybe shere a link of a video please
Thank you Michael. I've been searching on Google and could not find exactly what I need but did found one article where they use a for loop but mine doesn't work. Could you maybe shere a link of a video please
look on codebase, There is a link at top of this website. There are hundreds of examples.
the most simplest way:
if there are currently no open positions, you may open a position
if(PositionsTotal() == 0){ // Trade execution logic only within this condition }
Currently you're opening a position inside a loop, don't do that. You only need to loop through open positions when you want to modify positions, or check prices or profit information about the positions that are open
Thank you Conor. I'll go and change it tonight.
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