Kelly Ratio Lot Calculation?? and Finding Most Suitable MA For a Currency??

 

Hi i m new here.here is very good forum.i want to ask questions about mql4 programming.i want to use kelly ratio lot calculation in my eas.how can i do that?is there any sample here?can you give examples about it?i guess i should define a function that makes lot calculations using kelly ratio and i should return the right kelly ratio value and use this value as lotsize?is it true??

and i have one more question.i want to calculate moving averages for eur usd.i want to find most profitable moving averages for eur usd.i want to investigate what are the values of the moving average that create most profit when they cross each other?for example 5,6,7,......19,20 moving averages periods are fast ma periods.50,51,52,......99,1000 are slow ma periods.i want to find which crossing of slow ma and fast ma is the most profitable in my ea.how can i do this?is there any example about it?

can you help me? thank you very much..

 
Add two extern int's one for fast length, one for the slow, and use the strategy tester.
 
pipchampion2:

Hi i m new here.here is very good forum.i want to ask questions about mql4 programming.i want to use kelly ratio lot calculation in my eas.how can i do that?is there any sample here?can you give examples about it?i guess i should define a function that makes lot calculations using kelly ratio and i should return the right kelly ratio value and use this value as lotsize?is it true??

and i have one more question.i want to calculate moving averages for eur usd.i want to find most profitable moving averages for eur usd.i want to investigate what are the values of the moving average that create most profit when they cross each other?for example 5,6,7,......19,20 moving averages periods are fast ma periods.50,51,52,......99,1000 are slow ma periods.i want to find which crossing of slow ma and fast ma is the most profitable in my ea.how can i do this?is there any example about it?

can you help me? thank you very much..

Well you have a lot of study to do to find out how to do back testing in the strategy tester to test which moving averages are better than others. There are lots of example EAs provided with MT4.

Once you have a strategy that works on back test it will be easy to include some Optimal F (Kelly) lot sizing method. You obviously need to read your account balance [ AccountBalance() ] and know what size of stoploss you are using on the trade to calculate the optimal F value. You also need to put in the winning percentage and expected win/loss ratio. It might be best to just risk just 1% or 2% of your account per trade to start with.



Reason: