I want to create an indicator that plots a moving average, but dynamically adjusts the period. I use Ninjatrader, but the real issue for me, as usual, is conceptual. By that I mean how do I tell the computer what I really want.
I am a self-taught programmer and am not great at it, so I often go through this period at the beginning where I struggle to simply define what I want.
My intention is to have the user input a number of bars, called the LookbackPeriod, and have the computer determine what moving average period would result in the lows (or highs) of the bars in the LookbackPeriod intersecting the moving average a user-defined number of times, then plot that on the chart.
So far, I have the moving average plotting and dynamically adjusting, but not finding the number of intersections I intend, so there are obviously some problems in my code. That's what I'd like to brainstorm about.
If anyone finds the concept an interesting challenge and would like to discuss how to approach this, I'd definitely like to do so.
(On the other hand, if anyone wants to tell me I'm wasting my time, please don't bother. Thanks.)