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

SAR with buyprice/sellprice



PureBytes Links

Trading Reference Links

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.");