| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
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 |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
||||
|
ok somewhere down here I think I have to make the logic conditions that use the indicator to filter...
PHP Code:
if(isCrossed == 1 && point < **the top line variable from the custom indicator**- 25) if(isCrossed == 2 && point > **the bottom line variable from the custom indicator** +20) would that work, would that make the indicator filter the orders? no that's not right that doesn't separate the buys from the sells because it triggers both a sell and a buy on a buy signal and on a sell signal ...oy but which variable from the indicator? I'm still not certain which to use? if(isCrossed == 1 && Point < topindicatorlinevalue - longrange) if(isCrossed == 2 && Point < bottomindicatorlinevalue + shortrange) I have trouble getting the variable out of the indicator. I tried making a global variable to do it but that didn't work for me, I don't know why. I put this in the top part... //---- Filter Parameters extern double longrange = 25; extern double shortrange = 20; the compiler was ok with that.... I put this in the top part too.. double t[]; double b[]; then i tried to put the t and b where the indicator would give them it's values....right with the others... avg = findAvg(period, x); upper[x] = middle2 + (3.5*avg); lower[x] = middle2 - (3.5*avg); t[x] = middle2 + (3.5*avg); b[x] = middle2 - (3.5*avg); the compiler was still ok with all this... then i tried to do this where it orders buys... if(isCrossed == 1 && Point < t - longrange) it didn't work and I got this from the compiler... Compiling 'EMA_CROSSmodv4.mq4'... '-' - left square parenthesis expected for array C:\Program Files\Interbank FX Trader 4-live mini\experts\EMA_CROSSmodv4.mq4 (350, 38) '-' - unexpected token C:\Program Files\Interbank FX Trader 4-live mini\experts\EMA_CROSSmodv4.mq4 (350, 38) ')' - assignment expected C:\Program Files\Interbank FX Trader 4-live mini\experts\EMA_CROSSmodv4.mq4 (350, 48) 3 error(s), 0 warning(s) Last edited by Aaragorn; 06-30-2006 at 01:00 AM. |
|
|||
|
Quote:
So in icustom you may have the following: Code:
double dtb_high=iCustom(NULL,0,"Trend Bands v2",period,0,1); - NULL - EA will work for any currency (otherwise place simbol instead of NULL); - 0 - EA will work with the chart for any timeframe you attached to (otherwise place PERIOD_M30 for example or any); - "Trend Bands v2" - exact name of custom indicator; - period - period in indicator. This indicator is having some settings. In our case it is one only - period. It is 34 by default. You should place the folowing in the beginning of the EA: Code:
extern int period = 34; - 0 - it is line 0 (see image). - 1 - is first bar. Previous bar starting from current one. If I am wrong so somebody may correct me. |
|
|||
|
As I saw Kalenzo did it in different way.
I mean this one: Quote:
Code:
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) counted_bars=0;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
Code:
double dtb_high1=iCustom(NULL,0,"Trend Bands v2",period,0,i); double dtb_high2=iCustom(NULL,0,"Trend Bands v2",period,0,i+1); For line 2 (blue one) it may be the following: Code:
double dtb_low1=iCustom(NULL,0,"Trend Bands v2",period,2,i); double dtb_low2=iCustom(NULL,0,"Trend Bands v2",period,2,i+1); |