[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 513
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
Pro tips on how to make it optimise for opening prices in the auto-optimiser:
https://forum.mql4.com/ru/42125
advise how to write "if a previously closed order was a buy order and closed with a stop loss then sell 0.1 lot with a stop loss 50 take profit 50" please)
Specialists! Help! How can this be implemented?
We need to fix OPEN=true until the
condition2. Condition1 may change during this time.
Thanks in advance!
take it out for the start
take it out for the start
Thank you so much! As they say everything is brilliantly simple! And I've been racking my brains all day.
Please tell me what I'm doing wrong when calculating the number of first bars ( Quant_Bars ) that correspond to the condition only above or below the buffer. I.e. as soon as the indicator is drawn BEFORE the closed bar (1), I should count previous bars with the indicator BELOW the bars (except for those which don't conform to the condition) and vice versa, in the opposite direction of movement. My variant gives wrong values.
Who knows how to do it?
question,
Why, when my Expert Advisor neatly drains the entire deposit and practically all trades are losing, then when I change the "polarity" of the signals, the deposit does not increase as rapidly, but already? )))) the points are the same, the error is in the order opening direction only, or there is something else?
question,
Why, when my Expert Advisor neatly drains the entire deposit and practically all trades are losing, then when I change the "polarity" of the signals, the deposit does not increase as rapidly, but already? )))) the points are the same, the error is in the order opening direction only, or there is something else?
there is something else
Good afternoon.
There are 4 orders, 2 sells and 2 buys. Seals are created, figuratively speaking, when the price goes up and buy when it goes down. The sells are deleted when a buy is created and vice versa. When a ticket is created, the 1st sell or buy is stored in the variable pos. All 4 have the same comment - "Aelit". So, there is a code:
The order is selected normally by the ticket, but very often the comment comparison fails. For interest, I made else Alert(OrderComment()); and the log showed "Alert: Aelit[sl]". What is [sl]? Is it because all orders have the same comment? Then why was the same [sl] when I made a comment that didn't match the others for the test? If you remove the comment check, there is a ticket error in the log for OrderModify. At first I thought this condition was reached before any order was created, but no, at that time the order is already there, and the ticket is the same in case of condition triggering and not triggering. How do we understand it?
It is not a miracle that your brokerage company added to your comment - the order has closed when StopLoss was reached.
You have not correctly organized the order selection on the ticket. When making such a selection, first of all, MODE_TRADES is unnecessary - it is omitted in the OrderSelect() function,
Secondly, after the successful selection of the order, you don't check whether the order is selected from the array of orders according to the ticket - from the market ones or from the closed ones.
To do this, after the order is selected, check its close time and if it is equal to zero, then only then the order is a market one, otherwise - it is selected from the orders already closed (hence the addition to your comment)