Работа завершена
Техническое задание
The requirement here is to modify Stochastic RSI indicator attached. This is my second time attempting this project. The first attempt produced a very buggy version. I’ve attached it here for you to better understand the specification. Please don’t copy it as the spec has undergone some changes. Please use the specification below.
The requirement is to identify two indicator crosses that have happened at different levels. For shorts, its lower highs and for longs its higher lows. (see image attached)
1-For the short pattern(lower high);
A-The Stochastic fast line must print above the “primary level” input, in the image its set at 80.
B- Then the fast line must cross the slow line from above to down below the slow line at any level below the primary level input.
This accomplishes the first cross and the logic now begins to look for the second cross. The primary cross will be cancelled if the “primary cancel level” is met by the fast line while the pattern searches for the second cross. In this example “primary cancel level” will likely be set at 20. If this level is reached before the second cross is found the pattern begins all over again.
C-Once the primary cross occurs, the logic begins to look for the second cross. the second cross must subsequently happen below the primary level. For the second level to qualify, the fast line must print above the “secondary level” without reaching the “secondary cancel level”. Let’s say the “secondary level” is set to 50 and cancel level is set to 70(this is always set below primary level). The fast line must come up above 50 from below and print there without reaching 70. Then to complete the cross, the fast line must cross down passed the slow line and stay crossed for the number of bars inputted in the “min secondary cross bars” input. If “min secondary bar” is set to 2, then 2 consecutive bars must stay crossed for the cross to be complete. If the “secondary cancel level” is reached before the cross is complete then the pattern is reset and starts from the beginning at primary level.
2: For the long pattern (higher lows) everything is inversed.
Inputs;
A: cross type: 1 = lower high 2= higher low (lower cross is lower highs, and higher cross is higher lows)
B: PRIMARY LEVEL ____ If A is set to 1 and B is set to 80, then the stoch fast peak must appear above 80.
B2: Primary cancel level___ in this example likely set to 20, if the fast line pierces this level from above the primary pattern resets and must start over.
C: primary min cross bars___ The input here is the minimum number of bar after the cross where fast line remains under slow line in the first cross.must be met for cross to be valid (inverse for higher cross)
D: Secondary Level ____ Lets say this is set to 50, this means that the secondary cross must a least be over 50. (under 50 for cross type =2)
D2: Secondary cancel level: Lets say this is set to 70, this means that the secondary cross must not be over 70.(type=1) (under for cross type =2 (likely be set lower to 30)
E: Secondary level min offset: __ If the first peak reached is at 87 (stoch fast line level) and the second fast line peak is at 86 ,but the offset is set to 2, then it would disqualify this event. The difference between peaks must exceed the offset. This is the most important feature
F: secondary min cross bars___ The input here is the minimum number of bar after the cross where fast line remains under slow line in the second cross. This must be met for cross to be valid(over for higher cross)
G- Max Distance_____ this is measured in bars. If one inputs 20 bars, it means that the distance between first cross and second cross can not exceed 20 bars.
H- Min Distance ____ same as above but minimum
I: Add alert code
J: highlight color: set color that highlights from the first cross to the end of the second cross.
K: max bars back.
L: All other native indicator parameters must remain in place.
I need to use two indicators on the same chart so make sure there is no conflict.
NB: Put a value in a Lower cross buffer or an upper cross buffer when all condition are met so we can use it in an EA