Using the Period Converter Script

 

Hi

I have struggled with the period converter script and had given up on it, until a friend gave me this explaination.

Using the Period Converter script

-Get the 1 minute data from Alpari (M1)

-Delete all the .hst files of the currency pair you want to import from your

MetaTrader's history folder (for example C:\Program files/MetaTrader 4/history/InterbankFX Demo)

-In MT go to Tools -> Options and set max. bars in history and max. bars in chart to the

maximum by entering 99999999999 for each

-Go to Tools -> History Center and the currency pair you want to import and double click on M1. --Click on import and import the M1 data from Alpari that you just downloaded.

-Open a M1 chart of the currency pair

-Go to Tools -> History Center and the currency pair you want to import and double click on M1. Click on import

and import the M1 data from Alpari that you just downloaded.

-Drag the period converter script on to the chart and on the Inputs tab set the variable ExtPeriodMultiplier to 5 (for M5).

-After 30 sec or so doubleclick on the period_converter script in the MetaTrader Navigator window. This will stop the script the script and start it again. Click yes in the dialog box.

-Now start the script again and stop it after about 30 sec in the way described above with settings for ExtPeriodMultiplier of 15, 30, 60, 240 and 1440.

-Go to History Center, the currency you are importing, doubleclick on M5 and click on import. Now choose the path

C:\Program files/MetaTrader 4/history/InterbankFX Demo to import from and

there will be a file EURJPYM5 (if you are importing EURJPY) or similar, that the script just created.

Import from this file.

-Then go to M15 in the history center and import EURJPYM15 from C:\Program

files/MetaTrader 4/history/InterbankFX Demo

-Do the same for M30, H1 ... up tp D1

That's it

 

period converter

cardio:
Hi

I have struggled with the period converter script and had given up on it, until a friend gave me this explaination.

Hi cardio!

That's right. For more details review my article here:

http://www.metatrader.info/strategy-tester/metatrader-strategy-tester-part-2.html

 

Great site

Great site

I wanted to post a question at your site - but could not find where to do so. Anyhow my question is - on backtesting I get 'profit factor' and 'profit' - now the most profitable results seldom have the highest profit factor. I guess one just has to choose parameters somewhere between between the two - and hope for the best.

I believe the higher profit ones where just luckier. I don't know. If you could discuss this in one of your articles it would be great. I attach the current results for my optimize test on ema_cross on the USDJPy daily

 

the file

the file - struggling to post

 
cardio:
the file - struggling to post

Which EA you used? what's the MM strategy you used?

 

I found the problem

At interbankfx you have to put "EURUSDm" when trading EURUSD.

 

ema_cross_2

Hi

oops - I see I posted results with MM.

does MM stand for Money Management?

here are the results so far with no MM. (see attach). I stopped the test - it has been running now for about 12hrs. I don't know if all the test results posted as it says it was doing more runs, but on the optimization results no new results were posting - may be 5740 is the max number of runs.

I am using a slightly modified version of ema_cross_2 - I just added my MM, but modified the code before the test that it should not use the MM. That is all - it is suppose to always only buy 1 lot.

On live account I see my MM function is not working as planned - - whoa LOL (lots of laughs) that is scary. So I better try modify it.

I don't understand why my MM is not working right - have a look and see what you think

///////////////////////////////////////////////////////////////////////

//call by

Lots = Lotsize1(50,0.1,Symbol(),"mini");

double Lotsize1(int stoploss1, double risk1, string symbol1, string std_or_mini)

{

/* returns the number of lots one can buy for a certain symbol

* for a given risk level and stoploss. Returns Max 100 lots.

* The pip values for the function come from http://www.interbankfx.com/calculator.htm

* if you use a currency other then the dollar - get your own values.

* Inputs

* 1 stoploss1 - what is your stoploss i,e, 10, 20, 30 etc pips, ensure that trailingstop is

* - less then stoploss1

* 2 risk1 - how much of your accounts free margin are you willing to loss

* 0.03 for 3%, 0.1 for 10%

* 3 std_or_mini - enter "std" for a standard or demo account, where the minimum transaction size is

* 1 lot of 100,000 of the base currency or enter

* "mini" - where the minimum transaction size is 1/10th

* the size of a standard lot, or 10,000 of the base currency.

* 4 symbol2 : the symbol your dealing with e.i. "EURUSD"

* The function determines your accounts leverage

* and returns the number of lots that you can then purchase

*/

double AccountLeverage1; //the leverage of the current account

double pip; //one pip price - from http://www.interbankfx.com/calculator.htm

//this changes automatically based on either 'std' or 'mini'

double lots1;

//tocheck: before attaching EA - are your symbol definitions right?

if(symbol1 == "EURUSD" || symbol1 == "GBPUSD")

{

pip = 10;

}

else if(symbol1 == "USDCHF")

{

pip = 8.1;

}

else if(symbol1 == "USDJPY")

{

pip = 8.4;

}

//TODO: Actually if it can't find the right symbol - fail gracefully.

else return(0);// problem - just expand to include all symbols trading with

if (std_or_mini == "mini") // transaction size is 1/10th the size of a standard lot

{

pip = pip/10;

}

AccountLeverage1 = AccountLeverage();

pip = pip*AccountLeverage1/100;

//TODO: Don't loss more then risk% of AccountFreeMargin - not working right now

lots1 = NormalizeDouble(((AccountFreeMargin()/(stoploss1*pip))*risk1),2);

if (lots1 > 50)

{

if (std_or_mini == "mini")

{

lots1 = 50;

return(lots1);

}

if (lots1 > 100)

{

lots1 = 100;

return(lots1);

}

}

return(lots1);

}

/////////

So I am stuck again - I don't know if these attach results are without MM - I believe they are - but there are doubts as I had to stop the test. I will run a small test - much later - to check.

Any advice?

Files:
 
codersguru:
Hi cardio!

That's right. For more details review my article here:

http://www.metatrader.info/strategy-tester/metatrader-strategy-tester-part-2.html

Page not found

 
 
 
blooms:
Thanks a trillion.

www.metatrader.info is a new project we are creating.

Please visit http://www.metatrader.info/node/67 for the same article but in new portal (uploaded also there by codersguru).

Also this link can be interesting:

http://www.metatrader.info/book

Best regards.