Hi Everyone,
We have found a great topic to be discussed : Rays from swing points in a MTF strategy.
The main idea is to define the 2 (or 3 last) Rays from the 3 (or 4) last swingpoints,
(High rays AND Low rays, unlike the Trendlines indicator which plots only one or the other),
Then these last rays would be Crossed or not, and be used for comparison conditions.
(let's keep in mind that the sample is meant to be applied on any primary series, that is why nothing is inside if (BarsInProgress == 0))
Instead of adapting the Trendlines indicator wich includes alerts and plots only one side, and overall seems too complex for our use,
We decided to copy and adapt the syntax from this thread :
https://ninjatrader.com/support/foru...highs-and-lows
Because we only need the last few swing points, without the full TrendRay and TrendQueue classes, we defined one by one those points.
The attached sample illustrates how to define these last swing points and create rays from them.
It is a very close variation of the thread's piece of code.
Now begins the interesting part with just a few of many interogations :
-Would there be a shorter/more efficient way to write this "high and low points definition" ? (we don't need more points)
Is there a part from this code that would be better placed somewhere else in the script ?
-Even if we are in if (BarsInProgress == 1) and the dots show a synchronization between the series, the rays seen from higher chart series than [0] and [1] DO NOT synch.
We can see all that in the attached picture. (the swing indic is applied on the chart to see the last swing points)
Should we not see all rays (regardless of which primary it's applied on) passing by the swing points (squares) of series[1] ?
Why not in this case ?
-Also, when trying to instantiate this newly created ray S1UpTrendRay1 (line 121 and line 129), we get the cs1503 error.
https://ninjatrader.com/support/help...t8/?cs1503.htm. This was not enough hint for me to adapt to a drawing object.
What exactly should we do with S1UpTrendRay1 drawing object in order to make it comparable and compile the script ? (like tried with && (CrossAbove(Closes[1], S1UpTrendRay1, 1) == true ) )
Would anyone care to study swing points rays with us ?
These are 3 topics which could have their own thread. Should we divide them into 3 threads ?
Comment