In metatrader 4, MT4, develop an indicator by adding filters to an existing indicator, "BaseSignal." The indicator cannot repaint, and will be back testable; one will be able to look back on a chart to see where the signals occurred by seeing the arrows produced at the signals. The description of the indicator filters is described in the two image attachments.
1. To clarify, the BaseSignal does NOT repaint now, so it is not a problem to be solved on the existing indicator.
2. The pictorial description of "B-Bars" is corrected in the attached image file, "Sawtooth Long Corrected"
Logic in determining a Short signal (opposite, of course, for Long)
To identify a short signal, at each bar the new code needs to look for:
a. Condition 1: See if all conditions of BaseSignal are met (such as, for example, Close price is within 5 pips of 200 EMA, there is a down turn of Stoch coming off a point where the Stoch high was 70 or greater)
b. Condition 2: it now looks back at the past B-Bars (default 15 bars) for the Lowest Low to see if there was a point E where price was at least R-Pips (default 8 pips) lower than the High of the current bar within those 15 B-Bars. If conditions 1 and 2 are true ---
c. Condition 3: now it looks back (A-Bars – B-Bars) prior to point E, (example with defaults 60 – 15 = 45 bars) to see if there is a point D within those 45 bars where the High was M-Dif pips higher than point F.
d. IF True/False set to False for the condition of waiting for the first pink Heiken Ashi bar to be seen, a Short signal is generated at point F.
e. If True for True/False for Heiken Ashi bar requirement, it waits for up to H-Bars (default 5 bars) after point F for the first pink bar condition, and generates a Short signal at the close of this first pink bar.
- If no pink bar is found within H-Bars, then no signal is generated.
Note: Program will look back A-Bars (default 60 bars) to see if point D exists M-Dif pips above the high at Point F if Conditions 1 and 2 are true, regardless of whether Point E is found 1 bar or 15 bars prior to Point F. Point D must precede point E.