>>Where should i put the last 4 rules?
I only see two -- The ROC formula and the "Buy if closing up from yesterday". If you list the others, I can put them in.
>>In the buy and sell section?
Yes -- the BUY signal must be set with any/all conditions.
>>And maybe you can explain a little bit about their meaning.
OK, lesson time!<g> I've added comments and some flexible inputs to the indicator; let me know if it's too complex, and I'll simplify it:
_Test
{ Flexible Inputs }
Display:=Input("Display 0=Indicator 1=Signal 2=Season",0,2,1);
Level:=Input("Level",-10,10,4);
Pd1:=Input("Short",1,100,5);
Pd2:=Input("Medium",1,100,15);
Pd3:=Input("Long",1,100,25);
{ Criteria }
MyROC:=ROC(C,Pd1,%)+ROC(C,Pd2,%)+ROC(C,Pd3,%);
{ Conditions }
Buy:=Cross(MyROC,4) and C>ref(C,-1);
Sell:=Cross(Level,MyROC);
{ GENERIC: Filter repeat signals, 1=Buy, -1=Sell }
init:=Cum(IsDefined(Buy+Sell))=1;
Season:=ValueWhen(1,Buy-Sell<>0 OR init,Buy)*2-1;
Signal:=If(Season<>Ref(Season,-1),Season,0);
{ Display }
If(Display=1,Signal,If(Display=2,Season,MyROC));
Now, from the above Indicator, here is what you can do by creating and ATTACHing an Expert Advisor:
*************
EXPERT TABS
*************
TRENDS -- Use RIBBON button to set color. I set "Pattern" to (None).
------------
Bullish: FmlVar("_Test","Season")=1; { Ribbon=Green }
Bearish: FmlVar("_Test","Season")=-1; { Ribbon=Red }
Neutral: { Ribbon=Yellow }
HIGHLIGHTS
-------------------
Buy: FmlVar("_Test","Season")=1;
Sell: FmlVar("_Test","Season")=-1;
Default: 1
SYMBOLS -- Select symbol and color from the "Graphic" tab.
---------------
Buy: FmlVar("_Test","Signal")=1;
Sell: FmlVar("_Test","Signal")=-1;