Equity and balance graph - page 26

 
FOXXXi писал(а) >>

I just don't understand how the RF indicator calculates equity, and it is not clear how the MM is calculated, because we have the same position, how is it recalculated? I divided the profit value from the initial balance to the maximum equity point (and from initial balance to current equity) to the maximum drawdown.

RF = Current Equity / Maximal Drawdown. This formula is used in the indicator.

RF = (Current Equity - Initial Balance) / Maximum Drawdown. You are using this formula.

Which one is correct?

There may be several positions for different instruments opened at different times. When MM is enabled, the lot is calculated based on the current equity. It is not quite correct because free funds are not considered. Lot for one position is calculated from initial balance.

 
Xupypr >> :

RF = Current Equity / Maximum Drawdown. This formula is used in the indicator.

RF = (Current Equity - Initial Balance) / Maximum Drawdown. You are using this formula.

Which one is correct?

There may be several positions for different instruments opened at different times. When MM is enabled, the lot is calculated based on the current equity. It is not quite correct because free funds are not considered. For one position the lot is calculated based on the initial balance.

Now I understand why the RF in this indicator appears to be large: RF = (Current Equity - Initial Balance) / Maximum Drawdown.

I was referring to a single multi-position with different lots opened at the same time.

 

Corrected and updated in Code Base.

In this case, when MM is enabled, the lots are recalculated as part of the initial balance.

The MM function in the indicator is experienced and should be treated with caution.

 
Xupypr >> :

The MM function in the indicator is experienced and should be treated with care.

so does it work correctly now or...?

 
Correct, but for a deposit of 10,000 we can open as many positions as possible with the highest possible lot. As free funds are not calculated.
 

Oh, I remember that... I'll keep that in mind :)

I just thought there might be a problem with the function...

 

I have a question about the equitability calculation formula used in the indicator and scripts. Open prices are used in the original version (in v7 - Close), i.e. like this:

     if ( Type[ j]==OP_BUY) profitloss+= Commission[ j]+ CurSwap[ j]+(iClose( Instrument[ j],0, bar)- OpenPrice[ j])* Lots[ j]* lotsize;
     else
     {
      spread=MarketInfo( Instrument[ j],MODE_POINT)*MarketInfo( Instrument[ j],MODE_SPREAD);
      profitloss+= Commission[ j]+ CurSwap[ j]+( OpenPrice[ j]-iClose( Instrument[ j],0, bar)- spread)* Lots[ j]* lotsize;
     }

It has been found out (through testing, i.e. comparing indicators) that the indicator equity value does not coincide with that given by the MT4 tester. However, if we replace the prices with High (for buying) and Low (for selling), the indicators converge perfectly. Code for example:

         if( Type[ j]==OP_BUY)
         {
           profitloss += Commission[ j] + Swap[ j] + (iHigh( Instrument[ j],0, bar) - OpenPrice[ j]) * LotsArray[ j] * lotsize;
         }
         else
         {
           spread = MarketInfo( Instrument[ j],MODE_POINT) * MarketInfo( Instrument[ j],MODE_SPREAD);
           profitloss += Commission[ j] + Swap[ j] + ( OpenPrice[ j] - iLow( Instrument[ j],0, bar) - spread) * LotsArray[ j] * lotsize;
         }
Judging by the fact that this algorithm is used by the MT4 tester, we can assume that the server will calculate the drawdown in the same way. Hence the question - doesn't it make sense to tweak the indicator and scripts?
 

If you like it better that way, tweak it.

Maybe the tester uses such an algorithm, but it is not multicurrency. Therefore, this calculation is only valid for one instrument (without locks).

Use of close prices at least provides some synchronization between the instruments. What cannot be said about High and Low.

 
I do not understand why Open and Close are better in terms of synchronization of different instruments. If anything, extrema may better be a reference point for synchronization than artificially introduced Open/Close resulting from slicing the price stream by bars.
 

This cut is the same for all instruments. I.e. it is safe to say that at xx hours xx minutes there were such prices. Try to name the exact time of formation of ectrems, e.g. for D1.

Reason: