[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 Thomas,
 
OK, I get it now - I guess your problem would arise if:
 
1. You were long, and then got a short sig before a sell sig, or
2. You were short, and then got a buy sig before a cover sig.
 
Off the top of my head, you could try something like:
 

Cover = Cross(WRSI,30);

Sell = Cross(70,WRSI);

Buy = WRSI > 40 AND yestWRSI < 40

 AND BarsSince( Cover) < BarsSince( Short );

Short = WRSI < 60 AND yestWRSI > 60

 AND BarsSince( Sell ) < BarsSince( Buy );

Buy = ExRem( Buy, Sell );

Sell = ExRem( Sell, Buy );

Short = ExRem( Short, Cover );

Cover = ExRem( Cover, Short );

 

Steve

 

----- Original Message -----
Sent: Tuesday, January 10, 2006 5:12 AM
Subject: RE: [amibroker] Only long or short and no repeated signals

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