Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information
If I understand it right, you want your EA to treat an unbroken series of indicator agreement as "one signal", rather than that each occasion of agreement is a signal.
One way to do so, is to make it a stateful EA and use a design as follows:
PHP Code:
static int last_signal = 0; int signal = 0; if ( <buy conditions hold> ) signal = 1; if ( <sell conditions hold> ) signal = -1; if ( signal != 0 && signal != last_signal ) { // New signal series... } last_signal = signal;
If I understand it right, you want your EA to treat an unbroken series of indicator agreement as "one signal", rather than that each occasion of agreement is a signal.
One way to do so, is to make it a stateful EA and use a design as follows:
PHP Code:
static int last_signal = 0;
int signal = 0;
if ( <buy conditions hold> ) signal = 1;
if ( <sell conditions hold> ) signal = -1;
if ( signal != 0 && signal != last_signal ) {
// New signal series...
}
last_signal = signal;
It would be nice if you, TheRumpledOne, also learn how to attach images rather than make them inline; with the junk you paste in, it just wastes a lot of space.
It would be nice if you, TheRumpledOne, also learn how to attach images rather than make them inline; with the junk you paste in, it just wastes a lot of space.
mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Use MODE to tell your indicator what buffer you want. The support resistance indicators may use buffer 0 ( MODE=0 ) for resistance and buffer 1 ( MODE=1 ) for support.
SHIFT says to use the value from Bar(SHIFT) of the indicator called by iCustom.
mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Use MODE to tell your indicator what buffer you want. The support resistance indicators may use buffer 0 ( MODE=0 ) for resistance and buffer 1 ( MODE=1 ) for support.
SHIFT says to use the value from Bar(SHIFT) of the indicator called by iCustom.
Does that help?
Ok, I get Shift, will have to do more reading about Mode.
Do you code? I have this indicator that I call from my EA but not sure how to set it up properly. See pic.
it just has two lines and when Blue changes and lines up with the other line, Long signal is generated (Same idea with Red)
Tried a few different codes like the one I used with the VQ indicator;
double Entry1 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 1);
double Entry2 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 2);
double Up2 = iCustom(NULL, 0, "VQ", 24, 30....., 1, 2);
double Down2 = iCustom(NULL, 0, "VQ", 24, 30....., 2, 2);
Ok, I get Shift, will have to do more reading about Mode.
Do you code? I have this indicator that I call from my EA but not sure how to set it up properly. See pic.
it just has two lines and when Blue changes and lines up with the other line, Long signal is generated (Same idea with Red)
Tried a few different codes like the one I used with the VQ indicator;
double Entry1 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 1);
double Entry2 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 2);
double Up2 = iCustom(NULL, 0, "VQ", 24, 30....., 1, 2);
double Down2 = iCustom(NULL, 0, "VQ", 24, 30....., 2, 2);
Just not trading right.
Thanks
If you are referring to the bottom indicator, which seems to be named "#MTF CI", then I think that possibly that indicator has 4 buffers: one each for the two colors of each line. You can bring up the Data Window (ctrl-D) to see which buffers the indicators have, as well as their indexes (the MODE argument to the iCustom call).