Expert Advisor Testing Honest Predictor

Buy Testing Honest Predictor Expert Advisor in the store selling algo trading systems

This sim­ple Test­ing Hon­est Pre­dic­tor (THP) Expert Advi­sor was cre­at­ed in order to eas­i­ly and mean­ing­ful­ly test the Hon­est Pre­dic­tor indi­ca­tor (iHP) per­for­mances, with­in the MT4 Strat­e­gy Tester.

Giv­en an asset and a time­frame, THP selects a part of the posi­tions dis­played by iHP and prints on the jour­nal (screen­shot #2) the per­cent­age of win­ning posi­tions as if they were exe­cut­ed by a user.

It accepts only posi­tions for which iHP sug­gests a reli­a­bil­i­ty lev­el notUNRELIABLE” and a prob­a­bil­i­ty high­er than a giv­en Min­i­mum Accu­ra­cy.

From the tests done, the Hon­est Pre­dic­tor indi­ca­tor seems to avoid “nat­u­ral­ly” unfa­vor­able mar­ket con­di­tions, although a mul­ti-asset approach is need­ed to com­pen­sate for the low fre­quen­cy of posi­tions (note that the indi­ca­tor payed ver­sion can be attached on as many charts as you want, at the same time).

THP Usage

Input Para­me­ters:

  • Dura­tion of Back­test­ing in days: the dura­tion of the back­test­ing used by iHP to eval­u­ate accu­ra­cy (=per­cent­age of win­ning posi­tions) and reli­a­bil­i­ty lev­el
  • Indi­ca­tor Thresh­old: the lim­it above which iHP gen­er­ates a posi­tion.
  • Expiry Time in bars: the expi­ra­tion (in bars) for the posi­tions gen­er­at­ed by iHP.
  • Min­i­mum Accu­ra­cy: min­i­mum thresh­old of the back­test­ing iHP accu­ra­cy above which THP accepts the posi­tions gen­er­at­ed by iHP.
  • Ver­bosi­ty Lev­el: if =1 it also lists all the accept­ed posi­tion.

The first 3 para­me­ters are just passed to the indi­ca­tor (see here for a full descrip­tion).

Set the test­ing peri­od in the Strat­e­gy Tester, press Start (Open Price mode can be used) and THP will print on the jour­nal (screen­shot #2) the per­cent­age of win­ning posi­tions that you would have obtained by exe­cut­ing the indi­ca­tor posi­tions when its esti­mat­ed accu­ra­cy is above theMin­i­mum Accu­ra­cy and when the UNRELIABLE con­di­tion does not hold.

No trad­ing orders are per­formed.

Interfacing iHP to an EA

For users who want to embed the iHP with­in an Expert Advi­sor, I report below a code exam­ple.

His­to­ry­Days, Thresh­old and Expi­ra­tion con­tain the 3 para­me­ters val­ues that have to be passed to the indi­ca­tor.

Giv­en a bar shift (> 0 and < HistoryDays*1440/Period()), the first 4 buffers can be read to check if iHP found a posi­tion at that bar or not:

string IndiName = "HistoryPredictor.ex4"; //name of the available iHP executable
double UpWon=iCustom(NULL,0,IndiName,HistoryDays,Threshold,Expiration,0,shift);
double DownWon=iCustom(NULL,0,IndiName,HistoryDays,Threshold,Expiration,1,shift);
double UpFail=iCustom(NULL,0,IndiName,HistoryDays,Threshold,Expiration,2,shift);
double DownFail=iCustom(NULL,0,IndiName,HistoryDays,Threshold,Expiration,3,shift);

They refer to: win­ning CALL posi­tions (0), win­ning PUT posi­tions (1), los­er CALL posi­tions (2) and los­er PUT posi­tions (3).

EMPTY_VALUE is returned if there is no posi­tion of that type at that shift.

Please note that the posi­tion out­come is known only if shift > Expi­ra­tion, i.e. if it expired and the bar entered the back­test­ing peri­od. Oth­er­wise, while the out­come remains unknown, the posi­tion is record­ed only in buffers 0 or 1.

WARNING: if you plan to use your EA in the Strat­e­gy Tester at shift=1, then intra-bar mod­el­ing is need­ed and Every tick mode must be set! This is because iHP gen­er­ates posi­tions on var­i­ous ticks after the clos­ing time of the bar at shift=1.

To obtain sta­tis­ti­cal infor­ma­tion, both the total num­ber of posi­tions (6th buffer) and that of the win­ning ones (7th buffer) that were found with­in the iHP His­to­ry­Days-long back­test­ing peri­od can be read as:

int TotalHistoryPos = int( iCustom(NULL,0,IndiName,HistoryDays,Threshold,Expiration,5,shift ) );
int TotalHistoryWon = int( iCustom(NULL,0,IndiName,HistoryDays,Threshold,Expiration,6,shift ) );

For exam­ple, one could eval­u­ate the accu­ra­cy and ignore the last indi­ca­tor pre­dict­ed posi­tion when this accu­ra­cy is unknown or below 70%:

if (TotalHistoryPos == 0 || double(TotalHistoryWon)/double(TotalHistoryPos) < 0.7) return;

More­over, the p-val­ue can be read from the 8th buffer, for instance to exclude UNRELIABLE con­di­tions:

double pvalue = iCustom(NULL,0,IndiName,HistoryDays,Threshold,Expiration,7,shift);
if (pvalue >= 0.1) return;

Testing Honest Predictor

Relat­ed Posts
Expert Advisor Order Dumper
This EA is a tool for dump­ing open orders from your local Meta­Trad­er 4 client ter­mi­nal to a CSV file. This EA is bet­ter to work with Order­Copy EA. How to use? It …
Expert Advisor Assistant Trader Demo
Assis­tant Trad­er is a true trader’s assis­tant. It pro­vides the max­i­mum of func­tion­al­i­ty with the min­i­mum of set­tings. Atten­tion! It is a demo ver­sion of the Assis­tant Trader Expert Advi­sor to help …
Expert Advisor Moving Average N
Pecu­liar­i­ty of the mod­i­fied Mov­ing Aver­age EA is that it is pro­vid­ed with a NEURAL FILTER. We have select­ed the Mov­ing Aver­age EA as it is a stan­dard expert advi­sor …
Expert Advisor Goldup
The basis of the Goldup EA is the mod­ern indi­ca­tor Push­er. Goldup is run­ning based on the “Push­er always in a posi­tion” prin­ci­ple. How­ev­er, it has been sig­nif­i­cant­ly improved, short­com­ings …
Expert Advisor Virtual Collider Manual USDCHF
Vir­tu­al Col­lid­er Man­u­al is a trad­ing assis­tant with a built-in pan­el for man­u­al trad­ing. It auto­mat­i­cal­ly moves a posi­tion opened by a trad­er in prof­it using inno­v­a­tive adap­tive grid algo­rithm …
Expert Advisor Morning Trade Demo
The EA is ded­i­cat­ed to EURUSD for a peri­od before open­ing or in the begin­ning of the Euro­pean ses­sion. The EA tracks false sig­nals to the trend and works against …
Expert Advisor The Stream
The Stream trades the EURUSD with a risk/reward ratio of 1/15, risk­ing around 1% of account bal­ance per trade and mak­ing it a con­ser­v­a­tive Expert Advi­sor. Although 1:15 is a …
Expert Advisor MarkovChains EA Demo
This is the Demo ver­sion of the MarkovChains EA, which counts the past bars for rel­e­vant price pat­terns and cal­cu­lates the up and down price action prob­a­bil­i­ties. The full ver­sion …
Expert Advisor Shmendridge 1000
Fea­tures No mar­tin­gale or oth­er suspicious/dangerous MM. No sus­pi­cious drawdowns. Stan­dard bro­ker stop-loss placed on all orders. No hard-cod­ed tricks. Set your own risk to reward. Very sim­ple and safe mon­ey man­age­ment. Good set­tings will work across mul­ti­ple …
Expert Advisor MCAD PrbSAR noise
The MCAD Prb­SAR noise Expert Advi­sor trades by sig­nals of MACD and Par­a­bol­ic SAR indi­ca­tors and is opti­mized for EURUSD H1 by default. It can be opti­mized for any instru­ment …
Expert Advi­sor Order Dumper
Expert Advi­sor Assis­tant Trad­er Demo
Expert Advi­sor Mov­ing Aver­age N
Expert Advi­sor Goldup
Expert Advi­sor Vir­tu­al Col­lid­er Man­u­al USDCHF
Expert Advi­sor Morn­ing Trade Demo
Expert Advi­sor The Stream
Expert Advi­sor MarkovChains EA Demo
Expert Advi­sor Shmen­dridge 1000
Expert Advi­sor MCAD Prb­SAR noise

Leave a Reply


Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.