Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1549
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
It's good to talk when you know what to do...
help me with advice on how to "get as much useful information out as you can".
I've said it all quite clearly. Well for you personally, let me ask.
Here are two functions and both go through historical orders
Two cycles on the same orders. You cannot get everything that these functions return in one cycle, right?
hello!
I'm trying to add a trade reversal to the owl. I am doing it as described in the instructions: https://www.mql5.com/ru/forum/128200
I have no errors when compiling, but flip does not work in tester.
The log gives an error:
2021.07.29 20:06:34.316 2015.01.08 22:10:00 SMA with flip through code AUDUSD,M5: OrderSend error 130
2021.07.29 20:06:34.316 2015.01.08 22:05:45 SMA with reversal via AUDUSD,M5: OrderSend error 4107
2021.07.29 20:06:34.316 2015.01.08 22:05:45 SMA with flip via AUDUSD,M5: invalid stoploss for OrderSend function
Could you please tell me what is the problem here?
I myself think that the variables specified in
int ReversOrderSend (string symbol,int cmd,double volume,double price,int slippage,double stoploss,double takeprofit,string comment,int magic=0,datetime expiration=0,color arrow_color=CLR_NONE)Are not related to the main code.
I've tried it in different terminals, 4 and 5 signs.
here's the whole code:
I've already said it clearly enough. I'll ask you a personal question.
Here are two functions and they both cycle through historical orders
There are two loops on the same orders. You cannot obtain everything that these functions return in one cycle, right?
Alexei, I already wrote, I know you are a good programmer!
But I am not a programmer, and what is "clear enough" for you is not so clear for me...
As for the two loops, for me"In one loop get everything" is not possible, because they return different types of data.
Alexey, I already wrote, I know that you are a good programmer!
But I'm not a programmer and what is "clear enough" for you is dark forest for me...
As for the two loops, for me"get everything in one loop" is not possible, because they return different data types.
The returned types have nothing to do with it. If there are 2 loops on the same data with different checks and filters, you can always put everything in one loop, but the code will not read so clear, but it should work faster) At the stage of debugging I don't do everything in one loop. It is easier to look for bugs in different ones.
Alexey, I already wrote, I know that you are a good programmer!
But I'm not a programmer and what is "clear enough" for you is dark forest for me...
As for the two loops, for me"In one loop to get everything" is not possible, because they return different types of data.
I have two variants.
I have a conflict between pending orders.
First result. There is a conflict between currency pairs and EA has a conflict on pending order placement. For example, I have placed a pending order for EURUSD, EA has followed the algorithm (buy at 1.18901, open position, EA has set stop at 1.18751, take profit at 1.19051 and sell order at 1.18751) everything is ok as per plans.
But now it is time to open a deal at GBPUSD where the prices are different and the EA is doing everything right, except for setting a pending order. A Sell order at 1.39393 has triggered and the EA tried to open it, set a stop at 1.39633 and take 1.39153 but the buy order at 1.39633 was duplicated from EURUSD and the sell order was set at 1.18751)
I have just found another problem: a stop at 1.18751 and a sell pending order at 1.18901 and take 1.18595 were opened on EURUSD. The Expert Advisor didn't add the triggered stop, which is in the history.
These are the problems.
hello!
I'm trying to screw in a flip of the trades to the owl.
What do you mean? A certain range of prices from which you buy/sell?
Good afternoon. Help with the EA. According to the strategy, if a stop triggered, then the EA should add (the number of points) to the next set takeaway
from the history by ID, but it does not do it for some reason.
What is wrong in the code?
Makar correctly pointed to OrderMagicNumber(), but misunderstood the error. Read the documentation for the syntax of this function... it should be either the index in the list of orders or the ticket of a certain order, but not a magik. And OrderTicket() will not help here. Do not try to put it there.
What do you mean? A certain price range from which you buy/sell?
The author of the code, as I understand it, suggested the following:
if owl opens a buy trade with stop and take, then his piece of code opens a sell trade at the same time in the same place (taking into account the spread) also with stop and take instead of a buy trade.
thus the logic of search for an entry point of the EA does not change, and only the direction with spread taken into account changes.
this is exactly what i need
Describe in a nutshell what you want from this EA (the logic of operation),
I think you have a lot of unnecessary things in your code or I don't understand something.
owls should open trades according to their own algorithm
if the stop, the next trade with a Martin, and so on until the number of multiplications I specified (function -OrdersClose = .....;).
Further, if owl is disabled along with the terminal, just press "auto-trade" button with another owl, then the next trade will start with the starting lot, not with the last one increased by a martingale.
It would also be nice to attach a schedule to it, but this idea has only just occurred to me.
For example: it was activated at 10-00 on Monday with starting lot, then it was switched off during the day when some result was achieved, and on Tuesday morning it was activated again at 10-00 and started with starting lot again.
Everything.