Green Candle Low, Red Candle High

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
Import
Posts: 21
Joined: Wed Dec 29, 2010 5:28 pm

Green Candle Low, Red Candle High

Post by Import »

I'm trying to write 2 indicators in ChartScript, can anyone help me with this?

1. Green Candle Low:
Data Field 1: The current day low must be lower or equal (<=) to the lowest low of the preceding 20 trading periods
AND
Data Field 2: The current day close must be greater than (>) the low 1 day ago
AND
Data Field 3: The current day close must be greater than (>) the current day open

2. Red Candle High:
Data Field 4: The current day high must be greater or equal (>=) to the highest high of the preceding 10 trading periods
AND
Data Field 5: The current day close must be less than (<) the high 1 day ago
AND
Data Field 6: The current day close must be less than (<) the current day open

I've seen this in Think Or Swim written as:

Green CANDLE LOW
low<=lowest(low,20) and close>low[1] and close>open

RED CANDLE HIGH
high>=highest(high,10) and close<high[1] and close<open

Thanks,
Jeffrey
Chris White
Posts: 212
Joined: Mon Nov 29, 2010 9:21 pm

Re: Green Candle Low, Red Candle High

Post by Chris White »

Hi Jeffrey,

In the EdgeClub software (and also by extension in EdgeRater PRO) you can add chart script by going to the 'Security Chart' tab and pressing the 'Add' button above the library of chart scripts. The code you are looking for is as follows:

GREEN CANDLE LOW:

Code: Select all

cond1:= LOW <= LLV(LOW, 20);
cond2:= CLOSE > REF(LOW, 1);
cond3:= CLOSE > OPEN;

event: cond1 & cond2 & cond3;
RED CANDLE HIGH:

Code: Select all

cond1:= HIGH >= HHV(HIGH, 10);
cond2:= CLOSE < REF(HIGH, 1);
cond3:= CLOSE < OPEN;

event: cond1 & cond2 & cond3;
Thanks,
Chris.
Post Reply