Removing excess signals

lvgandhi

Well-Known Member
#1
I have the following code
_SECTION_BEGIN( "signals" );

BuyCond = bc1 OR bc2 OR bc3 OR bc4 OR bc5;
BuyLimitPrice = Ref( HHV( H, 5 ), -1 ) * ( 1 + 0.0005 );

Buy = Ref( BuyCond, -1 ) AND High >= BuyLimitPrice;
BuyPrice = ValueWhen(Buy,Max( BuyLimitPrice, Open ),1);
Sell = Cross( Ref( Hc3, -1 ), L );

Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
SellPrice=ValueWhen(Sell,Ref( Hc3, -1 ),1);

ShortCond = sc1 OR sc2 OR sc3 OR sc4 OR sc5;
ShortLimitPrice = Ref( LLV( L, 5 ), -1 ) * ( 1 - 0.0005 );

Short = Ref( ShortCond, -1 ) AND Low <= ShortLimitPrice;
ShortPrice = ValueWhen(Short,Min( shortLimitPrice, Open ),1);
Cover = Cross( H, Ref( Hc3, -1 ) );
CoverPrice=ValueWhen(Cover,Ref( Hc3, -1 ),1);


Short = ExRem( Short, Cover );
Cover = ExRem( Cover, Short );

Equity( 1 ); // THIS EVALUATES STOPS

Buydatenum = DateTimeConvert( 0, ValueWhen( Buy, DateTime(), 1 ) );
Buydate = DateToStr( Buydatenum );
ShortDateNum = DateTimeConvert( 0, ValueWhen( Short, DateTime(), 1 ) );
ShortDate = DateToStr( ShortDateNum );

Long = Flip( Buy, Sell );
Shrt = Flip( Short, Cover );
ExRem( BuyCond, Sell );
ExRem( ShortCond, Cover );

shape = Buy * shapeUpArrow + ( Sell == 1 ) * shapeDownArrow + ( Sell == 2 ) * shapeHollowDownArrow + Short * shapeDownArrow + ( Cover == 1 ) * shapeUpArrow + ( Cover == 2 ) * shapeHollowUpArrow;
shcolor = IIf( Buy, colorGreen, IIf( Sell, colorOrange, IIf( Short, colorRed, IIf( Cover, colorPaleGreen, colorBlack ) ) ) );
PlotShapes( shape, shcolor, 0, IIf( Buy OR Cover, Low, High ) );
Cshape=BuyCond*shapeUpTriangle+ShortCond*shapeDownTriangle;
Cshcolor=IIf( Buycond, colorGreen, IIf( ShortCond, colorOrange,Null));
PlotShapes( Cshape, Cshcolor, 0, IIf( BuyCond, Low, High ) );
GraphXSpace = 5;
_SECTION_END();

In spite of Exrem for BuyCond and ShortCond, I get BuyCond and ShortCond signals. How to avoid it?
 

saivenkat

Well-Known Member
#2
Ungala pala forum-ithala AFL pathi discuss panratha paathu irukane..neenga enda-na... doubt keekuringlaee.. aachriyamma irukku..

Bro.. If you have any good AFL for Position Trading.. will you please share..

Take care.

Saivenkat
 

Similar threads