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

Re: [amibroker] SAR with buyprice/sellprice



PureBytes Links

Trading Reference Links

Hi,

Your formula is almost correct. The only thing missing is
assigment of short trade prices:

coverPrice = buyPrice;
shortPrice = sellPrice;

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com

----- Original Message ----- 
From: <cliffelion@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, May 21, 2001 7:11 AM
Subject: [amibroker] SAR with buyprice/sellprice


> Tomasz:
> 
> The buyprice/sellprice feature is great!!
> 
> I am working on an indicator based on Wilders Parabolic Stop and 
> Reverse - can you verify that I am doing this correctly. 
> 
> A suggestion:
> the ability to select partial results of an exploration for a watch 
> list (CTL/SHIFT click to select ... then right click to move to watch 
> list)??
> 
> Regards,
> 
> Cliff Elion
> 
> 
> /* SAR with short/long/stops + commentary*/
> buyPrice = ref (sar(), -1); 
> sellPrice = ref( sar(), -1);
> buy = cross (high, buyPrice);
> sell = cross (sellPrice , low);
> 
> short = sell; cover = buy;
> 
> buy = ExRem( buy, sell );
> sell = ExRem( sell, buy );
> short = ExRem( short, cover );
> cover = ExRem( cover, short );
> 
> 
> /******************COMMENTARY*****************/
> /* Calculate stop for commentary */
> bsbuy = barssince( buy );
> bssell = barssince( sell );
> position = (bsbuy < bssell);
> longStop = 0.92 * valuewhen(buy,buyPrice);
> shortStop = 1.08* valuewhen(sellPrice,close);
> 
> fullname()+ "(**" + name() + "**)" + " as of " + date();
> 
> "\nCurrent Statistics\n";
> "Close: " + WriteVal(Close);
> "Change: " + WriteVal(Close - Ref( Close, -1 ) ) ;
> "\nPosition: " + writeif( position, "Long", "Short");
> "SAR Value: " + WriteVal(SAR());
> "SAR -1: " + WriteVal(ref(SAR(),-1));
> "Stop: " + writeif (position, writeval (longStop), 
> writeval(shortStop));
> 
> "\nRecent signals "+
> writeif( bsbuy > 5 AND bssell > 5, "no signals during last 5 
> periods.",
> writeif( bsbuy < bssell, "buy signal " + writeval( bsbuy, 3.0 ),
> "sell signal " + writeval( bssell, 3.0) ) + " periods ago.");
> 
> 
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
>