To answer the
divergence questions I wrote some instructions.
With the PriceActionSwingPro we can very easily create divergence signals based on any indicator or oscillator with a few tweaks in the code. The only requirement is that the base indicator has a plot or a public data series output to access the base indicator values within the PriceActionSwingPro.
To get the names of the data series that save the base indicator values you can look in the base indicators source code in the "properties" region for the words "public dataseries" and the word after this two words is the data series name.
E.g. the MACD has three different values where we can calculate the divergence on.
1. macd value (Plot name: "Macd" = DataSeries name: "Default" = "Value")
2. average value (Plot name = DataSeries name: "Avg")
3. difference value (Plot name = DataSeries name: "Diff")
If the indicator has no public data series but plots values like the FisherTransformation than the name of the public data series is "Value".
Now we have the name of the data series where all the values from the base indicator are saved and which one we want to compare against the swings to calculate the divergence.
The next step is to change the source code of the PriceActionSwingPro. NT's standard FisherTransformation will be used as example.
1. Create a variable of the base indicator in the region "Variables" in line 52.
private FisherTransform fisherTransform;
2. Change the "divergenceMode" to custom in the region "Variables" in line 138.
private DivergenceMode divergenceMode = DivergenceMode.
Custom;
3. Set the parameter of the base indicator in the param1, param2, parem3 variables in line 159. If the base indicator has only one variable use param1. Param2 and param3 are ignored. If the base indicator has more than 3 parameters create another parameter e.g. "param4" and make it public in the "properties" region.
private int param1 = 10;
4. Create the base indicator values. In the region "Create forms" in the region "Divergence" in the "case DivergenceMode.Custom" call the base indicator with the set parameters in line 675.
case DivergenceMode.Custom:
fisherTransform = FisherTransform(param1);
// Add custom divergence indicator here
break;
5. Access the base indicator values. In the "OnBarUpdate" function in the region "Initializes Variables" in the region "Divergence" in the "case DivergenceMode.Custom" access the base indicator values in line 1457.
case DivergenceMode.Custom:
divergenceDataHigh = fisherTransform.Value;
divergenceDataLow = fisherTransform.Value;
// Add custom divergence indicator here
break;
There is a high and a low series two to accomplish divergence calculation where the base indicator values (or another instrument) have a high and a low. e.g. candlesticks. With this solution you can also calculate divergence based on a different instrument, e.g. you have a FDAX chart and calculate divergence on the FESX.
6. And now we are already done! The PriceActionSwingPro indicator will do the rest. Just compile it and load it on a chart or in the market analyzer.