Testing the new EA...

 

Good Afternoon, dear Members,

now that i have backtested my EA it look my thought were the right ones for the beginning. Before setting it ino the wild i want to do some more testing. now my questions...

1. how can i run really loooong backtests even with the m1 chart? is there any limitations?

(2. How can i detect the minimum volume i have to trade with in a particular account (micro, mini, standard)?) i have found the answer to this, sorry for bothering.

3. How can i divide systems that deal just whole pips from such that support fractal pips?

thank you all

ChZ

 
chz:

Good Afternoon, dear Members,

now that i have backtested my EA it look my thought were the right ones for the beginning. Before setting it ino the wild i want to do some more testing. now my questions...

1. how can i run really loooong backtests even with the m1 chart? is there any limitations?

(2. How can i detect the minimum volume i have to trade with in a particular account (micro, mini, standard)?) i have found the answer to this, sorry for bothering.

3. How can i divide systems that deal just whole pips from such that support fractal pips?

thank you all

ChZ

Answers:

1. Limitations are where you are doing some significant processing with each incoming tick. This can cause strategy tester runs to take a long time. I've gotten around this on some of my EAs by creating a separate test mode, configurable by extern param and which avoids operations such as history lookups for notification and file writing for recovery, these functions being superfluous in a test.


3. Do you mean "How do I use the same EA against 4 and 5 decimal place brokers"? Assuming this is the case, I make use of the Point and Digits variables together with the NormalizeDouble() and DoubleToStr() functions in my multi-purpose EAs.


CB

 
cloudbreaker wrote >>

Answers:

1. Limitations are where you are doing some significant processing with each incoming tick. This can cause strategy tester runs to take a long time. I've gotten around this on some of my EAs by creating a separate test mode, configurable by extern param and which avoids operations such as history lookups for notification and file writing for recovery, these functions being superfluous in a test.

3. Do you mean "How do I use the same EA against 4 and 5 decimal place brokers"? Assuming this is the case, I make use of the Point and Digits variables together with the NormalizeDouble() and DoubleToStr() functions in my multi-purpose EAs.

CB

Hi Forum, hi Claudbreaker,

thank you for answering me. This is still my very first EA i am working on. It is already profitable :-), at least in strategy testing. now it is still a far way to taking it productive. My next steps are:

to 1.) backtesting it over a longer period and this is the point. When i start the backtester in the versions "use date" checked or not the period is too small for me to decide wether its profitable or not, because the testing period does not go further back than 20090529 in the m1 chart.

  • Do i have to load more history in a special way?
  • How far back can i go in testing the m1 chart?
  • I would like to test back to 2005 or 2002. Is this possible?

to 3.) yes, you are right. your way putting the question was way more precise than mine. Let me summarize what i know so far.

  • With Digit i find the last or lowest significant position of the rate where the Point is sitting, ok.
  • Does the Broker process just whole pips then 1Point = 1Pip,
  • does the Broker process 10ths of a pip then 1Point = 0.1Pips.

In my Opinion there must be a funcion or variable that tells me wether kind of broker i am dealing with. Or do i forget something to look at?

Thank you all for reading and helping.

ChZ

PS. I am already preparing the next step in my testing: letting it run on a testaccount. So i drag and drop it to the dedicated chart... but it does not do any actions, even the conditions would fit for trading... :-(

 
chz:

Good Afternoon, dear Members,


3. How can i divide systems that deal just whole pips from such that support fractal pips?

thank you all

ChZ

with some code like this in the init() function, remember to properly declare the two vars correctly first.

point = Point;
digits = Digits;
if (digits == 3 || digits == 5) {point*=10; digits--;}

 
bredin wrote >>

with some code like this in the init() function, remember to properly declare the two vars correctly first.

point = Point;
digits = Digits;
if (digits == 3 || digits == 5) {point*=10; digits--;}

Hi Bredin,

thank you... i am a newbie so i had to guess what it means.

if lowest significant position is at nr. 3 or at nr. 5

point = point *10;

digits = digits - 1 ;

endif

and then i use for all multiplication of a pip amount the point value to get the price, right?

thank you very much!

and now my problem that i already anounced in the PS of my previous posting:

I can run a test in the strategy tester, but the ea does not do anything when i put it to the chart. is there something wrong?

the expert tab says "loaded successfully and initialized" and i also output if trading is allowed, it say yes :-)

the journal tab says "loaded successfully"

but it does not trade, i am so sorry, i am sure it must be something ridiculous... can you please help me, dear community?

because i so much would like to publish the result, anyway, first i must see it work :-)

all the best and thanks

chZ

 

Update:

To Cloudbreaker and Bredin, and of course to the whole community

1. The question wether I can backtest a M1 chart far back and what i must do for it is right in the moment the only question regarding my EA

2. Thank you Bredin, i have coded your solution for my parts of a pips problem

3. The EA is now running in TestAccountMode... lets see what i did...

Thank you all

ChZ

 

update...

good morning dear community,

i am getting along with my new hobby writing an ea. i write updates here so that you can easily see which are my unanswered questions. the newest update substitutes all previous ones.

my open questions are:

  1. how can i backtest an ea attached to a m1 chart for a longer period than approximately just one month? what is the longest available period?
  2. my ea is running now in a test account and doing well so far, but i have a second test account where the ea is running but not doing anything. can this be because the broker symbols are named like XXXYYY.. (FirstCurrency concateneated to SecondCurrency concatenated to dotdot)? Solved
  3. i have all my trade monitoring based on the ticket number, not using the magic number so far. so i realized that i need to use the magic number to remember the open trades in case the ea gets restarted, is this right?
  4. can i use different magic numbers for different kinds of trades?
  5. do i have to use the #preprocessor command to #define it? and if, why?
  6. where can i get more information about the preprocessor commands that begin with #...

thank you all for your help!

ChZ

 
chz:

update...

good morning dear community,

i am getting along with my new hobby writing an ea. i write updates here so that you can easily see which are my unanswered questions. the newest update substitutes all previous ones.

my open questions are:

  1. how can i backtest an ea attached to a m1 chart for a longer period than approximately just one month? what is the longest available period?
  2. my ea is running now in a test account and doing well so far, but i have a second test account where the ea is running but not doing anything. can this be because the broker symbols are named like XXXYYY.. (FirstCurrency concateneated to SecondCurrency concatenated to dotdot)? Solved
  3. i have all my trade monitoring based on the ticket number, not using the magic number so far. so i realized that i need to use the magic number to remember the open trades in case the ea gets restarted, is this right?
  4. can i use different magic numbers for different kinds of trades?
  5. do i have to use the #preprocessor command to #define it? and if, why?
  6. where can i get more information about the preprocessor commands that begin with #...

thank you all for your help!

ChZ

1. Tools | History Centre | Import - you will need to identify a supplier of historic data and that's a whole subject in itself with many forum posts

3. The purpose of magic numbers is wider than the EA getting restarted. They are there to allow positive identification of an order or group of orders. And yes, if the EA gets restarted, the magic numbers are persisted on each order on the server. If you need to persist other data to make an EA recoverable, then you can use file access for example.

4. You can do whatever you like with magic numbers - its up to you.

5. No. You can generate your magic numbers within your code, in a way that is appropriate for how you wish to use them.

6. https://docs.mql4.com/basis/preprosessor


CB

 
cloudbreaker wrote >>

1. Tools | History Centre | Import - you will need to identify a supplier of historic data and that's a whole subject in itself with many forum posts

3. The purpose of magic numbers is wider than the EA getting restarted. They are there to allow positive identification of an order or group of orders. And yes, if the EA gets restarted, the magic numbers are persisted on each order on the server. If you need to persist other data to make an EA recoverable, then you can use file access for example.

4. You can do whatever you like with magic numbers - its up to you.

5. No. You can generate your magic numbers within your code, in a way that is appropriate for how you wish to use them.

6. https://docs.mql4.com/basis/preprosessor

CB

Hi dear Forum, hi dear CB!

Thank you all for your assistence. All my questions have found good answeres so far and lead to successful implementation into my first EA, yes i am still working on it. You all know it :-) there is again a question.

So what is my problem of today:

      lot=NormalizeDouble(AccountFreeMargin()*RiskPerTrade/
                          (100*StopLoss*PointMultiplyer),xxxNrDigitsADPxxx);

I look for a funktion that describes xxxNrDigitsADPxxx like in the example above.

xxxNrDigitsADPxxx = Number of Digits After the Decimal Point.

I know

if MINLOT is 0.1 I must take 1=one digit after the decimal point and

if MINLOT is 0.01 I must take 2=two digits after the decimal point

I just do not like to use such a clumsy kind of if, so I think it is the dekad logarithm of MINLOT, because:

if MINLOT is 0.1 then

(MINLOT = 10 raised to the power of -1) or

(MINLOT = 1 / (10 raised to the power of +1)), so the function that i am looking for returns -1 and i must take the minus of it so i have the number of decimals for my normalized double.

and one more example

if MINLOT is 0.01 then

(MINLOT = 10 raised to the power of -2) or

(MINLOT = 1 / (10 raised to the power of +2)), so the function that i am looking for returns -2 and i must take the minus of it so i have the number of decimals for my normalized double.

in the MT4 guide there is just a natural logarithm, my calculator (a very old TI30) that i have from schooltime (years ago, right after the dinos died out) has a Log and a Ln key. the MathLog funktion does same like the the Ln-key of my calculator. Finally, the Question is:

1. Which is the Funktion than delivers the 10-logarithm of a number? and/or

2. Is there a funktion that delivers the number of decimal places of the function MarketInfo(Symbol(),MODE_MINLOT)?

All the best for you all

ChZ

Reason: