Heikin Ashi Scanner in ThinkorSwim?

D

darkelvis

New member
VIP
Hi, random guy that knows nothing about coding here for my monthly check in again. Is it possible to create a scanner that will find green heikin ashi candles within the last 2 bars or would that be impossible? Thanks in advance.
 
H

HighBredCloud

Well-known member
VIP
Try this...comment out which one you're not using...I think BullishChange and BearishChange scan for stocks that just switched from from Bullish to Bearish and vice versa...than Bullish or Bearish which scan for stocks already in the specific condition.

Code:
# Heikin Ashi Bullish/Bearish Trend Change _JQ

# v01 dated 9.23.2018

# Scans for a change in the Heikin Ashi Trend to Bull from Bear

# relies on RHouser HA candle description code





def xClose = ( open + high + low + close ) / 4;

rec xOpen = compoundValue( 1, ( xOpen[1] + xClose[1] ) / 2, xClose );

def Bullish = if ( xClose - xOpen ) >= 0 then yes else no;

def Bearish = if ( xClose - xOpen ) <= 0 then yes else no;

def BullishChange = if ( xClose - xOpen ) >= 0 and ( xClose[1] - xOpen[1] ) <= 0 then yes else no;

def BearishChange = if ( xClose - xOpen ) <= 0 and ( xClose[1] - xOpen[1] ) >= 0 then yes else no;



#plot Scan = Bullish;

#plot Scan = Bearish;

plot Scan = BullishChange;

#plot Scan = BearishChange;
 
J

JonPM

New member
@HighBredCloud Thanks for this. How do you make it so that BullishChange is only true when the last 2 candles are green?
 
S

Sree6

New member
Try this...comment out which one you're not using...I think BullishChange and BearishChange scan for stocks that just switched from from Bullish to Bearish and vice versa...than Bullish or Bearish which scan for stocks already in the specific condition.

Code:
# Heikin Ashi Bullish/Bearish Trend Change _JQ

# v01 dated 9.23.2018

# Scans for a change in the Heikin Ashi Trend to Bull from Bear

# relies on RHouser HA candle description code





def xClose = ( open + high + low + close ) / 4;

rec xOpen = compoundValue( 1, ( xOpen[1] + xClose[1] ) / 2, xClose );

def Bullish = if ( xClose - xOpen ) >= 0 then yes else no;

def Bearish = if ( xClose - xOpen ) <= 0 then yes else no;

def BullishChange = if ( xClose - xOpen ) >= 0 and ( xClose[1] - xOpen[1] ) <= 0 then yes else no;

def BearishChange = if ( xClose - xOpen ) <= 0 and ( xClose[1] - xOpen[1] ) >= 0 then yes else no;



#plot Scan = Bullish;

#plot Scan = Bearish;

plot Scan = BullishChange;

#plot Scan = BearishChange;

Hi, Can you please help with the code to scan Bearish or Bullish DOJI's on a Heikin Ashi candles. Thank you!
 

Similar threads

Top