Smoothed Heikin-Ashi with ATR Trail For ThinkOrSwim

JoeDV

Member
Is there any scanner for this?

I use this in combination with ATRTrailingStop. Have to set the values to match whatever you're using obviously.
For a long signal, I look for SignalUp to cross above 0 within 2 bars and ATRTrailingStop to cross below the close within 2 bars.
However, you can adjust or modify to your needs.

Ruby:
#SHAScanner
input period = 20;

def openMA;
def closeMA;
def highMA;
def lowMA;

openMA = compoundValue(1, ExpAverage(open, period), open);
closeMA = compoundValue(1, ExpAverage(close, period), close);
highMA = compoundValue(1, ExpAverage(high, period), high);
lowMA = compoundValue(1, ExpAverage(low, period), low);

def haOpen;
def haClose;

haOpen = CompoundValue(1, ( (haOpen[1] + (openMA[1] + highMA[1] + lowMA[1] + closeMA[1]) /4.0)/2.0), open);
haClose = ((OpenMA + HighMA + LowMA + CloseMA)/4.0) ;

def haLow = min(lowMA, haOpen);
def haHigh = max(highMA,haOpen);

Plot SignalUp = (haOpen < haClose) and (haOpen[1] < haClose[1]);
Plot SignalDn = (haOpen > haClose) and (haOpen[1] > haClose[1]);
 

captbob123

New member
VIP
I'm trying to use HA smooth with atr and all I get is full page of buy and sells almost on every bar. Where as with stocks it's ok How to fix ?
thanks If you need a screen shot please advise or put in /cl Ive used minutes and ticks nothing matters. Tks Capt. Bob

It buys and sells on the same bar in oil even in the 5 minute version??? or longer Thanks for the help and fyi even on a day bar it trades a buy and sell on every bar Cheers.

It also is taking form 1 contract to over 670 contracts? I'm not that rich. lol

In reviewing the Shared_angle trend it does not like tick charts. Can a version be created to like tick charts? I got a version to work that does not show the trades as per my last email to you. Does the SAtrim repaint or is it live? thanks C. Bob
 

Similar threads

Top