[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 361
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Help
Note: in testing, the last known server time is simulated.
But in the indicator, when tested, the last known server time is not simulated, is it supposed to be?
It is simulated in the indicator, if the indicator is called from the Expert Advisor in the tester or optimizer mode. If it is in visual mode, the real time is taken.
Going to Minsk on the next train....
Here, estimate wrote a block of approximate control of the level of Equity in the area where I drained with the control gives a profit of 100% of the depo for 4 months
Look it up if you don't mind correctly there...
Any other thoughts on how to improve
Seems like a promising advisor, what do you think??????
The indicator is also modelled if the indicator is called from an EA in tester or optimiser mode. If in visual mode, the real one is taken.
It's a pity, what is a simple way to make the function work once a day in an indicator (tester)?
It is required to close a part of an open position (20, 30, 50, etc. %).
This requires that the remaining part of the lot meets the broker's requirements:
- At one broker - minimum lot and step: 0.1 and 0.01 respectively.
- At another broker - 0.01 and 0.01
- The third broker has 0.1 and 0.1.
Does anyone have any idea how to perform the check in the easiest way?
It is required to close a part of an open position (20, 30, 50, etc. %).
This requires that the remaining part of the lot meets the broker's requirements:
- At one broker - minimum lot and step: 0.1 and 0.01 respectively.
- At another broker - 0.01 and 0.01
- The third broker has 0.1 and 0.1.
Does anyone have any idea how to perform the check in the easiest way?
1. We may open X (0,15 etc.) in the same direction. We obtain ~0,25 (0,3 or whatever is necessary ... ) in total. - open in the other side as many orders as we would like... then close several orders.
2. how can one close more orders from below the plinth?
3. no way.
It is required to close a part of an open position (20, 30, 50, etc. %).
This requires that the remaining part of the lot meets the broker's requirements:
- At one broker - minimum lot and step: 0.1 and 0.01 respectively.
- At another broker - 0.01 and 0.01
- The third broker has 0.1 and 0.1.
Does anybody have any idea how to check in the easiest way?
The easiest option.
1. We calculate the necessary fraction (which must remain after closing). 2.
2. subtract from the received number of the minimum lot
3. round off this difference to the required accuracy.
4. add the minimum lot.
We have obtained the position size after closing it.
If needed in the code, I will do it later.
The algorithm will be fully usable and can be used practically with any brokerage company.
1. We can open X (0.15 etc.) in the same direction. - open in another direction as many orders as we would like... then close several orders.
2. How may I close more from below the plinth?
3. no way.
I`m afraid the opening of new orders will make everything more complicated :)
The easiest option.
1. Calculate the required share (which should remain after closing)
2) subtract the minimum lot from the obtained number
3. round off this difference to the required accuracy.
4. add the minimum lot.
We have obtained the position size after closing it.
If needed in the code, I will do it later.
The algorithm is quite usable and can be used practically with any brokerage company
The percentage (20, 30, 50, etc.) is set beforehand, at least for now.
The question is mainly about definition of "required accuracy" based on broker's requirements for min. lot and step (at the same time
the universality of the solution). Suppose 25% position needs to be closed with 0.72 lots: 0.01 step and 0.1 lot minimum.
The percentage (20, 30, 50 etc.) is set in advance, at least for now.
The question is mainly about defining the "required precision" based on the broker's min. lot and pitch requirements (so that there is
the universality of the solution). Suppose I want to close 25% of a position with 0.72 lots: a step of 0.01 and minimum lot 0.1.
Something like this has worked out for me.