Why not use the conditions that you defined for the colours?
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 (
EntrySignal OR
(EntrySignal==0 and ExitSignal
==0 );
but makes no sense as this now does not use entrysignal at all, so make it, even though I do not understand it
Buy = ExRem ( EntrySignal, ExitSignal ) AND ExitSignal==0 ;
SELL = ExRem ( eXITsIGNAL, eNTRYsIGNAL );
--Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm
It should beBuy = Buy AND (Color == colorGreen OR Color == colorWhite);----- Original Message -----From: J. BiranSent: Wednesday, August 16, 2006 12:58 PMSubject: RE: [amibroker] How do I code this?
I believe you meant (last line)Buy = Buy AND Color == (colorGreen OR colorWhite);
Joseph Biran
____________________________________________
From: [email protected] [mailto:amibroker@yahoogroups.com] On Behalf Of Ken Close
Sent: Wednesday, August 16, 2006 8:04 AM
To: [email protected]
Subject: RE: [amibroker] How do I code this?Well, you need a code definition for Green and one for WhiteThen I would separate the statementBuy = 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: [EMAIL PROTECTED]ps.com [mailto:amibroker@yahoogroups.com] On Behalf Of Bargains Club
Sent: Wednesday, August 16, 2006 10:25 AM
To: [EMAIL PROTECTED]ps.com
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.
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
YAHOO! GROUPS LINKS
- Visit your group "amibroker" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
