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

RE: [amibroker] Only long or short and no repeated signals



PureBytes Links

Trading Reference Links

Hi Steve,

 

i have tried, but it doesn’t work, because i have different buy, cover, sell, short rules. Buy and cover is not the same on my system.

 

You can view it by using your modified code on the price chart.

Probably i have to write it into my loop. L

 

 

WRSI = RSI( 14);

 

yestWRSI = Ref( WRSI, -1 );

 

Buy = WRSI > 40 AND yestWRSI < 40;

Short = WRSI < 60 AND yestWRSI > 60;

Cover = Cross(WRSI,30);

Sell = Cross(70,WRSI);

 

Buy = ExRem( Buy, Sell );

 

Sell = ExRem( Sell, Buy );

 

Short = ExRem( Short, Cover );

 

Cover = ExRem( Cover, Short );

 

// make short/cover negative so not hidden behind buy/sell

 

Short = IIf( Short, -1, 0 );

Cover = IIf( Cover, -1, 0 );

 

 

- - - - - - - - - - - - - - - - - - - -

Best regards

 

Thomas

www.tradingbasis.com

support@xxxxxxxxxxxxxxxx

- - - - - - - - - - - - - - - - - - - -

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Steve Dugas
Sent: Monday, January 09, 2006 11:32 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Only long or short and no repeated signals

 

Hi Thomas,

 

This seems to work fine - plot code as is, then uncomment "exrem" lines and plot in seperate pane below original - you can see how all redundant signals were removed by exrem.

 

Steve

 

WRSI = RSI( 14);

yestWRSI = Ref( WRSI, -1 );

Buy = Cover = WRSI > 40 AND yestWRSI < 40;

Short = Sell = WRSI < 60 AND yestWRSI > 60;

//Buy = ExRem( Buy, Sell );

//Sell = ExRem( Sell, Buy );

//Short = ExRem( Short, Cover );

//Cover = ExRem( Cover, Short );

// make short/cover negative so not hidden behind buy/sell

Short = IIf( Short, -1, 0 );

Cover = IIf( Cover, -1, 0 );

Plot( Buy, "buy", colorBrightGreen, styleLine );

Plot( Sell, "sell", colorRose, styleLine );

Plot( Short, "short", colorRed, styleLine );

Plot( Cover, "cover", colorGreen, styleLine );

----- Original Message -----

From: Tradingbasis

Sent: Monday, January 09, 2006 3:52 PM

Subject: [amibroker] Only long or short and no repeated signals

 

Hello,

 

i have some troubles to build a system that goes only long or short (not both at the same time) and only

goes long when no long position is opened and only short if no short position is open.

Can someone help ?

I have tried with the exrem but have not got it to work successfully. I want to display the signals graphically.

 

- - - - - - - - - - - - - - - - - - - -

Best regards

 

Thomas

www.tradingbasis.com

support@xxxxxxxxxxxxxxxx

- - - - - - - - - - - - - - - - - - - -

 



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