Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Start detecting morning/shooting star start /////////////////////////////////////////////////////////////////////////////////////////////
- //candle1 = left candle, candle2 = middle candle, candle3 = right candle
- Vars:
- candle1_Open(0),
- candle1_Close(0),
- candle2_Open(0),
- candle2_Close(0),
- candle2_Low(0),
- candle2_High(0),
- candle3_Open(0),
- candle3_Close(0),
- candle1_BodySize(0),
- candle2_BodySize(0),
- candle2_WickLength(0),
- candle3_BodySize(0),
- bullishStar(false),
- bearishStar(false),
- candle1_Open = open[2];
- candle1_Close = close[2];
- candle2_Open = open[1];
- candle2_Close = close[1];
- candle2_Low = low[1];
- candle2_High = high[1];
- candle3_Open = open;
- candle3_Close = close;
- //bullish calc first
- candle1_BodySize = candle1_Open - candle1_Close;
- candle2_BodySize = candle2_Close - candle2_Open;
- candle2_WickLength = candle2_High - candle2_Close;
- candle3_BodySize = candle3_Close - candle3_Open;
- //logic to figure out bullishish Star pattern formed
- bullishStar = (candle1_Close < candle1_Open) and ((candle2_Open <= candle2_Close) and (candle2_BodySize <= (.333333*(candle1_BodySize))) and (candle2_WickLength > candle2_BodySize)) and ((candle3_Open >= candle2_Close) and (candle3_Close > candle3_Open) and (candle2_BodySize <= (.333333*(candle3_BodySize))) and (candle3_Close > candle1_Open));
- //now calc bearish
- candle1_BodySize = candle1_Close - candle1_Open;
- candle2_BodySize = candle2_Open - candle2_Close;
- candle2_WickLength = candle2_Close - candle2_Low;
- candle3_BodySize = candle3_Open - candle3_Close;
- //logic to figure out bearish Star pattern forming
- bearishStar = (candle1_Close > candle1_Open) and ((candle2_Open >= candle2_Close) and (candle2_BodySize <= (.333333*(candle1_BodySize))) and (candle2_WickLength > candle2_BodySize)) and ((candle3_Open >= candle2_Close) and (candle3_Close < candle3_Open) and (candle2_BodySize <= (.333333*(candle3_BodySize))) and (candle3_Close < candle1_Open));
- // End detecting morning/shooting star start /////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement