Now i have hopefully functional suggestions to implement the code for the Camarilla- Pivot- Study. 2. should work with all pivot studies.
Two changes are for the file PivotPoints.java, see attached files.
One suggestion i cannot implement myself because i have no access to the file that defines the range for the calculation of the PivotPoints.
I hope that this will be a useful suggestion for the 1. Camarilla-pivot-Study and for 2. pivot point studies.
My support has run out, so i can not bring my suggestions to the Motivewave team. If you see value in them feel free to suggest them to the motivewave support team.
PivotPoints.java
1.
The PivotPoints R2, R3, S2, S3 have almost no relevance for trading. They should be replaced by the PivotPoints R5, R6, S5, S6. These are relevant in trending markets. A plus is, that the chart is not so crowded with the wide cam ranges. The calculation comes from Thor Young: A Complete Day Trading System. Calculations p. 49
Replace Lines 214 – 226:
} else if (Util.compare(pivotType, PivotSet.CAMARILLA)) { // accidently misspelled in first release
R3 = C + range * 1.1/4;
R4 = C + range * 1.1/2;
R5 = R4 + 1.168 * (R4 - R3);
R6 = (High / Low) * C;
S3 = C - range * 1.1/4;
S4 = C - range * 1.1/2;
S5 = S4 - 1.168 * (S3 - S4);
S6 = C - (R6 - C);
// Looks like the pivot line should be C (not P) in this case
ps = new PivotSet(time, end, C, R3, R4, R5, R6, S3, S4, S5, S6);
}
2.
It is possible that the lines 147- 148 do not function, because the calculations for the PivotPoints comes after the command that shows the data with the onBarClose Method. If not needed for something else these lines should be deleted and added at a place after the calculation of the pivotpoints.
The goal is to get the new Pivot Points on the chart at the weekend and not only at the opening of Premarket on Monday like now. So we can analyse with the study for the next week making it more valuable as a front running indicator.
Shift Lines 147-148 to 347-348 :
@Override
public void onBarClose(DataContext ctx) { calculateValues(ctx); }
3.
I can not implement the Premarket and Postmarket dat in the calculation for the PivotPoints, as the range is defined in another file that I have no access.
There are markets with PivotPoints that function better with or without Premarket and Postmarket data.
It would make sense to implement an option to calculate the Camarilla-Pivot-Points with or without Premarket and Postmarket data, like other software has.
Suggestion to implement in the corresponding file that sets the range:
range = max(high, premarket_high, postmarket_high) - min(low, premarket_low, postmarket_low)