Normally, I have no issues with Cross function. However, this code snippet is producing a result where my shapes (arrows) seem to be offset and late 1 bar. Shifting plotshape offset by -1 makes things worse. Am I doing something wrong? (Arrows should appear at crossover points).
@SwingTradeMonkey if you Plot the values of the indicator you will see the arrows are properly placed (at least on my charts) . It is on the Close of the bar that the indicator is calculated and that is when the Cross has occurred.
If you go back one bar, the cross has not yet taken place as you can see by the values.
@SwingTradeMonkey I think the lines just appear to "jump" because you are drawing a continuous line between two data points that are not connected by any other data points.
I mean if you have two lines moving different ways and one moves up and one moves down then surprise surprise… they will cross at certain coordinates. And if there is no bar index there then what is supposed to be wrong about that fact that there is no bar index there at lines cross? Do you want to invent new bar indexes just so that you have an extra funky monkey bar index at cross of lines? Think man, think what cross means!
@portfoliobuilder is 100% correct. Under a maximum magnification, I can see the crossover does occur between bars. So the arrows are positioned on the next available bar where an action (e.g. buy) can take place.
The Thinkorswim platform plots this indicators arrows in the same manor, showing some crossovers happening between days. I wonder if there is anything we can or, for that matter, should do to the formula to synchronize the crossovers to plot so they show “on the bars” rather than between bars!
Thanks to this forum, I am learning something new every day!
I also feel good about building this forum for future visitors. Thanks Again!
--> You are going for a record. Currently only Tomasz is better than you in creating new threads ...
A new thread, in most cases, means new issues to be solved or help to be provided by other members. I would say those who offer their time and knowledge for free and help others, might have slightly more input into building the forum than those who ask
Without Good Questions, there would not be any Good Answers!!! And I am certainly getting many good answers!
I hope that many others, in the near future will gain valuable insight from the answers we provide on this platform.
While I do review and try to provide answers to other’s questions where possible, I hope that one day I will be answering far more questions than I am asking!
Again, thanks EVERYONE for the valuable input. The time everyone puts into this forum is very much appreciated and, in my case, is being put to use in real time!
I wonder if there is anything we can or, for that matter, should do to the formula to synchronize the crossovers to plot so they show “on the bars” rather than between bars!
I meant to post this on my last post a few hours ago. If it helps you with the concept you can plot your indicators as discrete data points with no lines. Most people I think prefer looking at lines for many indicators but you just need to remember that the lines are "imaginary" between data points. The lines are really just "connecting the dots".