You'd better start to read the docs and the book.
Otherwise you wouldn't have written:
cclose1=iccI(NULL,0,14,PRICE_TYPICAL,0) cclose2=iccI(NULL,0,14,PRICE_TYPICAL,0)
will cclose1 and cclose 2 ever become different?
and
If(cclose1 >100 && cclose1<-100&&
(despite the gramm. error) this will never become true - why?
I know what he wants. The problem is, he don't know how to use it properly.
Basically to open buy, cclose1 must be at -100 or smaller and cclose2 at least bigger than cclose1 so that it will go into upward direction.
To open sell, cclose1 must be at 100 or bigger and cclose2 at least smaller than cclose1 so that it will go into downward direction.
I bet it is something like that.
I know what he wants. The problem is, he don't know how to use it properly.
Basically to open buy, cclose1 must be at -100 or smaller and cclose2 at least bigger than cclose1 so that it will go into upward direction.
To open sell, cclose1 must be at 100 or bigger and cclose2 at least smaller than cclose1 so that it will go into downward direction.
I bet it is something like that.
cclose1=iccI(NULL,0,14,PRICE_TYPICAL,0); static bool wasP100 = false; static bool wasM100 = false; if(cclose1 > 100){ wasP100 = true; if(!wasM100) return; // No -100 yet. wasM100 = false; // Reset for next time. OpenOrder(); return; } if(!wasP100) return; // Waiting for +100. if(cclose1 <= -100) wasM100 = true; // Saw -100 wait for next +100. return; // Waiting for -100 and/or +100.Not compiled, not tested.
cclose1=iccI(NULL,0,14,PRICE_TYPICAL,0); static bool buyEnabled = true; static bool sellEnabled = true; if(cclose1 > 100 && buyEnabled){ BuyEnabled = false; SellEnabled = true; OpenOrder(OP_BUY); return; } if(cclose1 < 100 && sellEnabled){ BuyEnabled = true; SellEnabled = false; OpenOrder(OP_SELL); return; } return; // Waiting.Not compiled, not tested.
Deysmacro your right but not actually what I want.just as describe in the pic I want cclose1 to start from 100 down to -100 then move up again to 100 level before buy order is opened. I know how to write trading logics once it explain properly like you did above though not actually what i need, or better still if you can help me code it, that's fine. All am trying to archive is for logic as describe on the picture to suit my trading ea system logic.
double cci[20]; for(i=0;i<20;i++) cci[i]=iCCI(NULL,0,14,PRICE_CLOSE,i); for(i=1;i<20;i++) { for(j=i+1;j<20;j++) if(cci[0] > 100 && cci[1] <= 100 && cci[i] > -100 && cci[i+1] <=-100 && cci[j] < 100 && cci[j+1] >= 100)
please one more thing please what code to add to an ea to only open 1buy order in an uptrend and one order in a selling trend. i mean after one buy the ea stops and wait for sell signal to complete before opening another order. just one trade per uptrend and one trade per down trending.
or time value to make the ea wait 1HR before another trade.pls help
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
if icci indicator is above 100 and less than -100 then greater than or equal to 100 ( OPEN BUY)
Please can someone help me.
Below is the image of what I want the code to perform.