Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 73
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 afternoon. How can I calculate a single Stop Loss for a series of orders with exact magic numbers, so that this series of orders can close at breakeven. For example, there are 3 orders: 1 Buy lot 1.3320 with magic 1, 1 Buy lot 1.3345 with magic 2 and 1 Buy lot 1.3360 with magic 3. How should I calculate the total Stop Loss for all orders so that if there is a move against the price the orders are closed without losing?
What is the point of averaging StopLoss? As soon as I close one position at SL, the others are immediately closed at Close! No need to lose precious pips!
On the one hand, yes, but on the other hand I see an immediate vulnerability: an order may not be closed by an EA for many reasons, and a Stop Loss will be closed anyway, otherwise this is a serious reason to complain to the broker. + Disconnection will not allow an order to be closed. Anyone else have any ideas to implement this algorithm for the total SL for the order pyramid?
On the one hand yes, but I see an immediate vulnerability in the fact that closing an order by an EA may not be executed for a variety of reasons, and a stop loss will close anyway, otherwise this is already a serious reason for a claim against the broker. + Disconnection will not allow an order to be closed. Who else has ideas to implement this algorithm for common SL for a pyramid of orders?
I can't get a handle on it, I don't know what the problem is. The task is as follows: find the bar of a given time on the minutes. If the time has not yet arrived, look for it in yesterday, otherwise look for it in today's day. I have written the following script:
This is what it outputs:
The algorithm there is as follows. We look at the difference between the current time and the given time, and if it is less than zero, we shift a day back. Then we divide the difference by 60 and round upwards, this will be the number of the bar on M1 and look at its time. It does not coincide with the one set in the externs. Where is this algorithmic error?
I can't get a handle on it, I don't know what the problem is. The task is as follows: find the bar of a given time on the minutes. If the time has not yet arrived, look for it in yesterday, otherwise look for it in today's day. I have written the following script:
This is what it outputs:
The algorithm there is as follows. We look at the difference between the current time and the given time, and if it is less than zero, we shift a day back. Then we divide the difference by 60 and round upwards, this will be the number of the bar on M1 and look at its time. It does not coincide with the one set in the externs. Where is this algorithmic error?
Look at the history to see if all the bars are present.
You can cycle from the found value in while() to the bar you are looking for. I'll give it a try.
I can't get a handle on it, I don't know what the problem is. The task is as follows: find the bar of a given time on the minutes. If the time has not yet arrived, look for it in yesterday, otherwise look for it in today's day. I have written the following script:
This is what it outputs:
The algorithm there is as follows. We look at the difference between the current time and the given time, and if it is less than zero, we shift a day back. Then we divide the difference by 60 and round upwards, this will be the number of the bar on M1 and look at its time. It does not coincide with the one set in the externs. Where is this algorithmic error?
Practising, or didn't like iBarShift()?