Hi,
Can someone able to help me with this system. I try to reduce
all "timeframeexpand" and also don't understand why this code don't
respect the cond2 and cond4 (MACD>0 and MACD<0).
Hope you understand what i try to explain. :)
MY CODE :
Temp = in45minute;
Mm = 20;
TimeFrameSet( Temp);
MA_H=MA(H,Mm) ;
MA_B=MA(L,Mm) ;
MACDind= MACD(12,26);
MACDsign= Signal(12,26, 9);
Div = MACDind - MACDsign;
TimeFrameRestore( );
MACDind1= TimeFrameExpand( MACD(12,26) ,Temp);
MACDsign1= TimeFrameExpand( Signal(12, 26,9),Temp) ;
Div1 = MACDind1 - MACDsign1;
MACD_1 = TimeFrameExpand( Ref(div1, -5),Temp) ;
MACD_2 = TimeFrameExpand( Ref(div1, -4),Temp) ;
BuyPrice = TimeFrameExpand( MA_B,Temp) ;
SellPrice = TimeFrameExpand( MA_H,Temp) ;
ShortPrice = TimeFrameExpand( MA_H,Temp) ;
CoverPrice= TimeFrameExpand( MA_B,Temp) ;
Cond1 = Cross(High,TimeFram eExpand(MA_
B,Temp)) OR Cross
Low,TimeFrameExpand (MA_B,Temp) );
Cond2 = MACD_1>=0 AND MACD_2>=0;
Cond3 = Cross(TimeFrameExpa nd(MA_H,Temp) ,High) OR Cross
(TimeFrameExpand( MA_H,Temp) ,Low);
Cond4 = MACD_1<=0 AND MACD_2<=0;
Buy = Cond1 AND Cond2;
Sell = Cond3 OR TimeNum() > 151000;
Short = Cond3 AND Cond4;
Cover = Cond1 OR TimeNum() > 151000;
_SECTION_BEGIN( "SIGNAUX" );
Sign_Buy = ExRem(Buy,Sell) ;
Sign_Sell = ExRem(Sell,Buy) ;
Sign_Short = ExRem(Short, Cover);
Sign_Cover= ExRem(Cover, Short);