Have an alarm indicating when a Doji Star has been created. Is this possible?
FW
You need to define what is a Doji by some ratio value - here seen as iDoji
Something like...
extern double iDoji=8.5; // Divisor for calculating body/height ratio of a candle start() { // ==================== Your Code ============================= if(IsDojiCandle()==1) { Alert("Doji candle formed"); Print("Doji candle formed"); } // ==================== Your Code ============================= return (0); } int IsDojiCandle() {int retval=0; if( (Body(1) < ((High[1] - Low[1])/iDoji)) ) retval=1; return (retval); } double Body (int iCandle) { double CandleOpen, CandleClose; CandleOpen=Open[iCandle]; CandleClose=Close[iCandle]; return (MathMax(CandleOpen, CandleClose)-(MathMin(CandleOpen, CandleClose))); } double BodyLo (int iCandle) { return (MathMin(Open[iCandle], Close[iCandle])); } double BodyHi (int iCandle) { return (MathMax(Open[iCandle], Close[iCandle])); }
Hello,
I wish to have an alarm indicating when a Doji Star has been created. Is this possible?
Thanks,
Fred