[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] How do I code this?



PureBytes Links

Trading Reference Links

 
I believe you meant (last line)
 
Buy = Buy AND Color  == (colorGreen OR colorWhite);



Joseph Biran
____________________________________________

 

 

  _____  

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of Ken Close
Sent: Wednesday, August 16, 2006 8:04 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] How do I code this?


Well, you need a code definition for Green and one for White
 
Then I would separate the statement
 
Buy = ExRem(EntrySignal, ExitSignal);
Sell = ExRem(ExitSignal,EnterSignal);
Buy = Buy AND  (Green OR White);
 
Sell is already defined.
 
Green and White need to evaluate to logical 1 or 0.
 
Ken

  _____  

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of Bargains Club
Sent: Wednesday, August 16, 2006 10:25 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] How do I code this?



 I want BUY = (when color is GREEN or WHITE), how do I code it please?

 

Here are my code..

 

//*******************************************************

//  #4 VOLATILITY Ribbon CODES

//*******************************************************

EntrySignal = C > ( LLV( L, 10 ) + 2 * ATR( 10 ) );

ExitSignal = C < ( HHV( H, 10 ) - 2 * ATR( 10 ) );

Color = IIf( EntrySignal, colorGreen, IIf( ExitSignal, colorRed,
colorWhite ));

TrailStop = HHV( C - 2 * ATR(10), 15 );

ProfitTaker = EMA( H, 13 ) + 2 * ATR(10);

 

Buy = ExRem( EntrySignal, ExitSignal ) AND (COLOR IS GREEN OR WHITE);

SELL = ExRem( eXITsIGNAL, eNTRYsIGNAL );

 

Thanks for your help.