Please check my first EA :) - page 2

 

Ok, why did this trade happen? (Red line)

Here is the EA

Files:
 

Entry code for two indicators

double VQ0 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0,0);

double VQ1 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0,1);

double QQEA0 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 0);

double QQEA1 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 1);

This code will buy when the previous value of both indicators moved up. So lets say VQ0=1.02 (shift is current bar) and VQ1 = 1 (shift is 1), QQEA0=2.5 and QQEA1 =2.4 then the rule will be true because VQ0>VQ1 and QQEA0>QQEA1. The entry will happen on te following bar. This is why the sell tade happened. Both moved down on previous bar.

So when you program entries in EA think about what you actually program.

double QQEA0 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 0); means you use the custom indicator Null = any pair (current pair you test on) 0=any timeframe, "QQEA" is the indicator you use, 5,14,4.236 is your extern inputs for the indicator and 0 is the buffer (it can be 0 to 7) and 0 is the shift (is it the current bar, previous or say 10 bars ago. The shift can be anything.

So when you use icustom you must decide which buffer you want to use. So look at the values on your indicator and decide which buffer you want to use and how to use it. I hope this help you.

 
derikb:
double VQ0 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0,0);

double VQ1 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0,1);

double QQEA0 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 0);

double QQEA1 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 1);

This code will buy when the previous value of both indicators moved up. So lets say VQ0=1.02 (shift is current bar) and VQ1 = 1 (shift is 1), QQEA0=2.5 and QQEA1 =2.4 then the rule will be true because VQ0>VQ1 and QQEA0>QQEA1. The entry will happen on te following bar. This is why the sell tade happened. Both moved down on previous bar.

So when you program entries in EA think about what you actually program.

double QQEA0 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 0); means you use the custom indicator Null = any pair (current pair you test on) 0=any timeframe, "QQEA" is the indicator you use, 5,14,4.236 is your extern inputs for the indicator and 0 is the buffer (it can be 0 to 7) and 0 is the shift (is it the current bar, previous or say 10 bars ago. The shift can be anything.

So when you use icustom you must decide which buffer you want to use. So look at the values on your indicator and decide which buffer you want to use and how to use it. I hope this help you.

OK, thank you. So should I use a shift of all '1' because I want the EA to check on candle open what the previous candle did then trade if all indicators agree? How do I make sure it only trades at first signal and not later if indicators continue in a direction?

 
derikb:
Hi, I've changed the code so that it enter trades. Two versions. One only trade when their is an up or down arrow (My first EA2) and the other one trades when the indicator moves upward so if previous trade was profitable or loss and VQ still moves up it will enter another buy trade. I hope this help.It isn't the best coding but then the EA is spagetti code.

Regards

Derik

Derik, what is wrong here? I'm trying to add another indicator.

double Entry1 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0, 1);

double Entry2 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0, 2);

double Up2 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 1, 2);

double Down2 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 2, 2);

double Entry3 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 1);

double Entry4 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 2);

double Up3 = iCustom(NULL, 0, "QQEA",5,14,4.236, 1, 2);

double Down3 = iCustom(NULL, 0, "QQEA",5,14,4.236, 2, 2);

[/code]

[code]

//Buy

if (Up2==Down2 && Entry1>Entry2 && Up3==Down3 && Entry3>Entry4 && .....

Looks like the QQEA indicator doesn't like the up3 down3 stuff What should I use with this indicator so it only trades once per first signal? Gives this error in the Journal tab;

2008.02.02 18:09:52 TestGenerator: unmatched data error (high value 1.9634 at 2008.01.24 11:38 and price 1.9651 mismatched)

 

I think this is what you want.

double Entry3 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 1);

double Entry4 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 2);

double Up3 = iCustom(NULL, 0, "QQEA",5,14,4.236, 1, 2);

double Down3 = iCustom(NULL, 0, "QQEA",5,14,4.236, 2, 2);

If I understand correctly you want a cross. When the QQE indicator cross up or down you want an entry. The code should be:

double QQE1 = iCustom(NULL, 0, "QQE",5, 0, 1);

double QQE2 = iCustom(NULL, 0, "QQE",5, 1, 1);

double QQE3 = iCustom(NULL, 0, "QQE",5, 0, 2);

double QQE4 = iCustom(NULL, 0, "QQE",5, 1, 2);

Add the following to the buy entry:

QQE1>QQE2 && QQE3<QQE4

Add the following to the sell entry:

QQE1QQE4

So I think the custom indicator name is wrong.... it must be QQE according to your graph - QQE is the compiled name of the indcator.

The indicator give two values for each bar stored in buffer 0 and 1. So the previous bar value1 (iCustom(NULL, 0, "QQE",5, 0, 1);) must be higher than value2 (iCustom(NULL, 0, "QQE",5, 1, 1);) and value1 two bars ago must be smaller (iCustom(NULL, 0, "QQE",5, 0, 2);) the value2 two bars ago (iCustom(NULL, 0, "QQE",5, 1, 2);). This is for a buy signal.

Hope this help.

 

My QQE indicator only have one extern in the indicator - iCustom(NULL, 0, "QQE",5, 0, 1); It is equal to 5 if you have more than one extern you have to add it.

 
derikb:
My QQE indicator only have one extern in the indicator - iCustom(NULL, 0, "QQE",5, 0, 1); It is equal to 5 if you have more than one extern you have to add it.

Ok, thank you.

One more please See pic, three different indicators what Two of them do is it has two Lines with Red and Blue. On each indicator, when they both Turn blue at the same time trade Long or when they both turn Red at the same time go short. See pic. The third one only has one line. Please tell how to iCustom these ones, please. Thanks again.

Files:
indicators.jpg  48 kb
 

hi matrixebiz,

that indicator on your last picture you posted, wich is it please, is this one of steinitch has indicators ?

Cold you be so kind, to post it maybe?

Thanx a lot,

 

Question

Hello. I am interested in this EA. Personaly, I am also using VQ Trade on FX market. How is this EA result actually ?

In my case, VQ and RCI (Spearman.mq4) is good combination for me.

Do you guys think VQ and RCI mutch for FX market ?

Files:
ima.jpg  69 kb