[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 36

 
Mathemat:

...

P.S. Honestly, I can't understand how it's possible that equity is higher than the growing balance almost all the time, but the drawdown is so big. I have my doubts about the drawdown calculation algorithm...

Alexey, could you tell me, do I understand correctly that the drawdown is calculated based on equity including its value during the periods when trades are opened and the equity curve is displayed on the chart (as well as the balance) by closed positions? I.e., it appears that we cannot say (in this case) on the current report chart where the equity line has fallen during open positions if the instrument price has not moved towards open orders with its subsequent return to profit... Right?
 
Roman.: The equity curve (as well as the balance) is shown on the chart (in the report) for closed positions?

No, the equity is not based on closed ones, but on the balance and all open ones.

I've written before about how to correctly (imho) calculate drawdown. You need to know two histories - equity and balance. The drawdown is calculated incorrectly without the balance knowledge (imho again!).

If no more than one position may be opened in the system, the equity curve is not visible at all (which is logical).

In fact, it is high time to draw candlesticks rather than equity lines.

 
Mathemat:

No, the equity is not based on closed ones, but on the balance and all open ones.

I've written before about how to correctly (imho) calculate drawdown. You need to know two histories - equity and balance. The drawdown is calculated incorrectly without the balance knowledge (imho again!).

If not more than one position is opened in the system, the equity curve is not visible at all (it is logical).

In fact, it is high time to draw candlesticks rather than equity lines.


Now, got it, thank you.

Yes, I remember those posts on calculation of max drawdown.

 

Guys, can you tell me if there is a way to track the amount of input/output funds in a trading account for a certain moment (period) of time?

Search by request: " how to track the number of deposited/withdrawn funds programmatically" site:mql4.com - Did not find any document...

I suspect that only through tracking values

double AccountBalance( ) 

at different time periods and then comparing them.

 
Roman.:

Guys, can you tell me if there is a way to track the amount of input/output funds in a trading account for a certain moment (period) of time?

Search by request: " how to track the number of deposited/withdrawn funds programmatically" site:mql4.com - Did not find any document...

I suspect that only through tracking values

at different time periods and then comparing them.


OrderType()==6
 
Vinin:


If I understand correctly, with a check on the condition of orders in the market? -

...
if (OrderType()<2) 
//здесь  корректировка размера позиций с учетом ввода/вывода
 

People, HEEEEEEELP!!! I've been messing around with the solution to this problem for days now and can't figure out how to implement it! Can anyone help? I need a code which implements the idea: when the MA 20 crosses the middle MA 30 from bottom to top, put a BUY STOP pending order at maximum of the candle, where the crossover occurred:


 
Mathemat:

Max, if you still do not consider 90.36% drawdown dangerous, then trade on it.

P.S. Frankly speaking, I cannot understand how come equity is higher than the growing balance almost all the time, while the drawdown is so big. I have my doubts about the drawdown calculation algorithm...

It seems to me that if equity is higher than the growing balance - the correct entry point(s) was chosen (albeit randomly), all that remains is to correctly exit......

About the tester - some things are not quite clear to me. For example, orders are not always closed in "hatch mode" and if the EA closes orders rather fast on a demo or real account, the tester procrastinates their closing until the next signal "smearing the result".


Roman.:

First of all, make at least 200 trades. Arrange control over the opening of a new bar and test it using the "Open prices ..." model (don't allow making deals within the minute bars - everything must be strictly at the open prices, for Expert Advisors with explicit control of the new bar). Besides, when placing orders and modifying them, don't forget to perform the necessary checks, making necessary processing of possible errors on this (and other) issue. That is all, IMHO.
I'm afraid - "for many trades" )) may crack at the seams of the depo and, moreover, there will be no suitable, really tasty signals on the minutes during this period of time. The model is built exactly with the control of opening of a new bar. About "opening prices" - interesting, I will try it. Thank you.
 
Roman.:


The other issue here, as I understand it, is that zeros are returned after requesting freeze levels, and as a consequence, a wrong modification and a re-quote or error again.

2Urain - Have there been any cases of non zeros being returned after asking for these levels?

Thanks to whoever responded, I have tracked down the error cases,

Stoplevels and Freezelevels in this brokerage company are indeed always 0, which is true, the above errors pop up when the stops are just equal to the market quotes,

you are correct, the stop is at 0 from the market so it is frozen or unacceptably close to be moved.

 
Question, how can I programmatically close all orders, e.g. every 30 minutes?
Reason: