I shall try to write Pip_Hunter rules as I undertstand them, based on the attached document. If everything is right we can start coding the EA.
D1-1 strategy.
Long signal:
1. Both 9 and 18 ma are pointing upwards or one is pointing upwards and the other is flat.
2. Within the past 15 bars, ADX was above 16 at least in one closed bar.
3. There is not a bearish divergence according to pip rev rules.
This bar is called a set up bar. Buy at the open of the next bar.
Stop loss is the highest of 175 pips and set up bar low.
Exit half position at ATR(5) pips above order open price. Trail the second half at LL3-LL3*0.001.
The initial LL3 counts 3 previous bars from and including the set up bar. Subsequent LL3's count from the one bar just closed.
Short signal:
1. Both 9 and 18 ma are pointing downwards or one is pointing downwards and the other is flat.
2. Within the past 15 bars, ADX was above 16 at least in one closed bar.
3. There is not a bullish divergence according to pip rev rules.
This bar is called a set up bar. Sell at the open of the next bar.
Stop loss is the lowest of 175 pips and set up bar high.
Exit half position at ATR(5) pips below order open price. Trail the second half at HH3+HH3*0.001.
The initial HH3 counts 3 previous bars from and including the set up bar. Subsequent HH3's count from the one bar just closed.
D1-2 strategy.
Long signal:
1. 40 ma greater than 40 ma of the 5th past bar.
2. LL10 higher than LL35.
3. Within the past 5 bars, 3 ma based on the low is pointing downwards in at least in one closed bar.
4. HH3 lower than HH10.
5. Within the past 15 bars, ADX was above 16 at least in one closed bar.
6. There is not a bearish divergence according to pip rev rules.
Set a pending long order at at HH3+HH3*0.001. If the entry point is not hit on the following bar from set up bar then the pending order is cancelled.
Stop loss at LL3-LL3*0.001.
Exit half position at ATR(5) pips above order open price. Trail the second half at LL3-LL3*0.001.
The initial LL3 counts 3 previous bars from and including the set up bar. Subsequent LL3's count from the one bar just closed.
Short signal:
1. 40 ma lower than 40 ma of the 5th past bar.
2. HH10 lower than HH35.
3. Within the past 5 bars, 3 ma based on the high is pointing upwards in at least in one closed bar.
4. LL3 higher than LL10.
5. Within the past 15 bars, ADX was above 16 at least in one closed bar.
6. There is not a bullish divergence according to pip rev rules.
Set a pending short order at at LL3-LL3*0.001. If the entry point is not hit on the following bar from set up bar then the pending order is cancelled.
Stop loss at HH3-HH3*0.001.
Exit half position at ATR(5) pips below order open price. Trail the second half at HH3+HH3*0.001.
The initial HH3 counts 3 previous bars from and including the set up bar. Subsequent HH3's count from the one bar just closed.
D1-3 strategy.
Long signal:
1. 18 ma is pointing downwards.
2. Point 3 is defined when LL4 is equal to LL20.
Question: Sould it be absolutely equal or a small difference is allowed?3. Point 3 is lower than point 1. The number of bars between these two lows should be no more than 15 bars and no less than 5 bars.
4. Stochastics %K should be lower than 15 at least once for the two bars following point 1.
5. The lowest of Stochastics %K within the two bars following point 3 should be higher than the highest of Stochastics %K within the two bars following point 1.
Question: Are the bars after points taken into account?6. Stochastics %K of the set up bar points upward and Stochastics %K of the previous bar points downward. If this occurs then low of the set up bar should be higher than point 3 or a long outside bar is formed. If a long outside bar is formed its low is point 3.
Question: The described outside bar rules are correct?7. Close of the set up bar is higher than 18 ma.
8. Within the past 15 bars, ADX was above 15 at least in one closed bar.
Question: The ADX limit is 15 or 16 as in the other strategies?Set a pending long order at 18 ma.
Stop loss is 1 pip below point 3.
Exit half position at ATR(5) pips above order open price.
If we are in the 4th or 5th bars from the entry trail the second half at (point 3)-(point 3)*0.001.
If we are after the 5th bars from the entry trail the second half at LL3-LL3*0.001.
Short signal:
1. 18 ma is pointing upwards.
2. Point 3 is defined when HH4 is equal to HH20.
3. Point 3 is higher than point 1. The number of bars between these two lows should be no more than 15 bars and no less than 5 bars.
4. Stochastics %K should be higher than 85 at least once for the two bars following point 1.
5. The highest of Stochastics %K within the two bars following point 3 should be lower than the highest of Stochastics %K within the two bars following point 1.
6. Stochastics %K of the set up bar points downward and Stochastics %K of the previous bar points upward. If this occurs then high of the set up bar should be lower than point 3 or a long outside bar is formed. If a long outside bar is formed its high is point 3.
Question: Both long and short signal use a long outside bar?7. Close of the set up bar is higher than 18 ma.
Question: Close of the set up bar shouldn't be lower than 18 ma for a short signal?8. Within the past 15 bars, ADX was above 15 at least in one closed bar.
Set a pending short order at 18 ma.
Stop loss is 1 pip above point 3.
Exit half position at ATR(5) pips below order open price.
If we are in the 4th or 5th bars from the entry trail the second half at (point 3)+(point 3)*0.001.
If we are after the 5th bars from the entry trail the second half at HH3+HH3*0.001.