Code snippets - page 13

 
mntiwana:

No,my question was a bit different,may be i have not explained well ...... when you embed your indicator "#resource "\\Indicators\\hilo.ex5""

and then call by a global "HANDLE" function

do you needs all required parameters here "

Handle=iCustom(_Symbol,PERIOD_CURRENT,"::Indicators\\hilo.ex5",0,0,..................................);"

same as we do with icustom call .... i don't means less or more , i means all that a indicator have or that we required to add in EA.

mntiwana

It does not matter if the indicator is called he usual way or it is embedded in the ex4/ex5 as a resource : the parameters passing is still exaclty the same, nothing changes regarding that part

 
mladen:

mntiwana

It does not matter if the indicator is called he usual way or it is embedded in the ex4/ex5 as a resource : the parameters passing is still exaclty the same, nothing changes regarding that part

Dearest MLADEN

Thanks for explained help.

regards

 

Hi mladen,

2 things:

has someone (or can) code a time function that uses the Windows system clock instead the mql4 datetime functions ?

And second: has someone a code snippet or library for professionell Order functions (OrderSend, Modify...) that not only shows in case of error

the error and descriptons ect., but, lets say a requote or other error happens, automatically retrys the ordersend ? And handles the refreshrate () ect.

correctly ?

i coded this (or better: try :-) ) this for myself (the trade functions), but i am not so good and sometimes get stange errors :-)

thank you

 

Hello,


i forgot : the same for a codesnippet for Money Management.

Has someone a good code that let us choose different strategies, like Percent of Equity, Percent of (Equity) StopLoss , Larry Williams... ect.

 
Jaque:

Hello,


i forgot : the same for a codesnippet for Money Management.

Has someone a good code that let us choose different strategies, like Percent of Equity, Percent of (Equity) StopLoss , Larry Williams... ect.

You always have to sue stop loss if you want to use % to risk
 
mladen:
You always have to sue stop loss if you want to use % to risk

The first uses the following formula : Number of Units = Equity * Risk(%) /  ContractSize *  Leverage

If your equity growths, your Lot size becomes bigger.


The second, more common and what you mean, is called (as i know) Equity percent with stop/aka Fixed Fractional:

Formula is: 

Lots = Equity * Risk% / (Stop Loss in Pips * Pip Value) / 100


I use the second, too, dont know if the first one make really sense. But it would be nice to have a snippet to chose from different MM strategies