Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Thanks Fat Tails, I'm actually doing this in SC, but there is nobody to answer SC programming questions, so I ask for c# and then translate to c++. SC doesn't plot the same as NT, but you have put me on the right track and I am finally making progress on this.
This really is black magic and I like it! I've been attempting to build on your sample ana3barPredictor by creating an indicator that calls an instance of MACD for the Line and Average using [-1] for the input:
While this works incredibly well I haven't got a clue how it works; I can't seem to find any documentation on what [-1] represents or what it is actually doing? I also have one small issue. The calling indicator (above) is getting the values of the MACD_DiNapoli as if COBC=false. In order to make this work at all I had to set COBC=false in the MACD_DiNapoli but I want it to be true. If I set it to true in the nested indicator I get no output at all. Is there any way that I can force COBC=true in the nested indicator or at least force the calling indicator to use COBC=true for the nested values?
@WolfieWolf: The term Value[-1] does not always exist, so it may well throw an exception. An essential ingredient of my little indicator were the try{} catch{} brackets in order to limit the damage in case that there was no such thing as Value[-1]. Also note that I had asked to displace the indicator that calls the ana3BarPredictor. The displacement compensates for the negative input values for all but the last few bars.
What do you try to achieve?
Joe DiNapoli has used displaced moving averages and other indicators, but his indicators had an additional lag introduced, which would be the opposite of the ability to shift indicator plots forward.
Thanks for the quick response. To answer your question, "What am I trying to achieve".. I've developed an automated Ninja Strategy based on a simple MACD crossover. It doesn't have to be the DiNapoli MACD, the standard one will do. My signals are quite good but they are, IMHO lagging by one bar; if I could get my signal one bar earlier I would have much better entries and exits. In some cases turning a loser into a B/E and good winners into exceptional ones, etc. So I was attempting to "predict" the MACD values of the next bar so my strategy could execute one bar early. What I have found, however, is that there is a difference between the values of this predictive code real-time vs historic and I can't figure out what's going on. If I do a replay, displaying the indicator on the chart, and then refresh the scripts, the values change. The historic values are exactly what I want, in real time. In a lot of cases the crossovers are much too early, real time. My early assumption was that the [-1] code was using intra-bar data, and not the close of bar data, but now I'm not sure. Any ideas?
Thanks again - you don't realize how much you have helped me just through your participation / involvement in this forum.
You should not be astonished that predictions do not match historical data. Predictions are always false, nothing can be predicted. A prediction is always based on an underlying assumption such as
-> price does not move during the period for which the prediction is made (no feedback)
-> price continues its way in the direction of the prior move (positive feedback)
-> price reverses back to the mean (negative feedback)
Of course nobody knows which of the assumptions is correct, and therefore all predictions hava a high probability of being flawed. That is the reason that I never have used them, except for fun.
If you base your signal on a prediction, your signal will come earlier, but you cannot be sure that the signal will be generated as predicted. In the end you do not gain anything.