Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1640

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
Good day all!!!
I'm writing code for an EA for Trailing Stop of group orders from the average price of a grid of orders.
No errors in the log, but the trawl does not work either. Here is the code please suggest where the error is. Thank you!
The trawl is in the wrong place!
It should look something like this
If breakeven price+profit-tral! = TakeProfit, start trawl!
Where does this data come from?
OrderOpenPrice
Returns the open price of the selected order
doubleOrderOpenPrice();
Note:
The order must be pre-selected using the OrderSelect() function.
Thank you.)
That's not where the trawl is standing!
It should go like this:
if the breakeven price+profit-tral! = TakeProfit run the trawl
Good afternoon Makar!!!!
As far as I understand it this is the line in question. In this case a buy order:
Makar if you could explain in more detail
That's not where the trawl is standing!
It should go like this:
if the breakeven price+profit-tral! = TakeProfit run the trawl
Where does this data come from?
Makar, you're talking in riddles today.
There may be another question why we calculate the breakeven price without checking????
That's not where the trawl is standing!
It should go like this:
if the breakeven price+profit-tral! = TakeProfit run the trawl
Where does this data come from?
OrderOpenPrice
Returns the open price of the selected order
doubleOrderOpenPrice();
Note:
The order must be pre-selected using the OrderSelect() function.
Yes, I thought of that and you've already written
Good afternoon Makar!!!!
As far as I understand it, this is the line in question. In this case a buy order:
Makar if you can explain in more detail
You have a group of orders, you define a breakeven point and create a line, and this is better done as a separate function!
Then you have the profit value in pips that you want to get and add / subtract to / from avg_price
And then a separate trawl function
for buying: if BID > avg_price = OrderModify()
for sales: if avg < avg_price = OrderModify()
Unfortunately in your code I see not logical actions (subjectively)
That's what I was thinking and you've already written.
Separate out the functions so it's easier for you to navigate.
Here's an example of OnTick()
As you can see there are only function calls
Separate the functions to make it easier for you to navigate.
Here's an example of OnTick()
As you can see there are only calls to functions.
Thank you, Makar. I'll concentrate my thoughts and think this way
Thank you, Makar. I'll put my thoughts together and think in that direction.