Decrease Factor

 

Hello,can everybody tell me,what is the " Decrease Factor" in a EA ?

What means that?

webman

 
webman:
Hello,can everybody tell me,what is the " Decrease Factor" in a EA ?

What means that?

webman

Hi. It can be absolutely anything the programmer of the EA intended it to be - but it's obviously to reduce some variable at a certain rate......

 

decrease factor's algorithm

dear gurus:I am an newbie in MQL4,just find an method of cut positions when lossing, the code as follows:

extern double DecreaseFactor = 10;

if(DecreaseFactor>0)

{

for(int i=orders-1;i>=0;i--)

{

if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; }

if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;

//----

if(OrderProfit()>0) break;

if(OrderProfit()<0) losses++;

}

if(losses>1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);

however I use it to backtrack,the results disorient me.

the follow are some trade log:

type order no size price profit balance

buy 1 2.00 1.3345 0.00 50000.00

close 1 2.00 1.3272 -1555.74 48444.26

sell 2 1.90 1.3297 0.00 48444.26

close 2 1.90 1.3361 -1292.00 47152.26

buy 3 1.50 1.3354 0.00 47152.26

close 3 1.50 1.3315 -656.81 46495.45

sell 4 1.30 1.3306 0.00 46495.45

close 4 1.30 1.2956 4436.60 50932.05

the question is :

2 is the default size in my EA,but what the "lot" stands for in the equation 2 or the latest size?

why the order 4's size becomes 1.30?

PLS guru show the arithmetic process TKS!

 

I moved your post to this thread as I did not find more suitable location sorry.

I am not a coder but look at the following examples with this factor (as mql4 codes example):

https://www.mql5.com/en/forum/173295 (it should be few versions of EA coded on this way)

https://www.mql5.com/en/forum/175560 (as I understand - Phoenix is having this factor too)

and more: https://www.mql5.com/en/forum

besides, this Decrease factor is usually used in some EAs based on breakout - I am not sure about the following links but concerning the Eas which I am forward testing - most of them are having it coded:

https://www.mql5.com/en/forum/general

https://www.mql5.com/en/forum/176377

https://www.mql5.com/en/forum/172928