I have a simple question and please excuse my lack of knowledge (not a high school or middle school grad). Programming is a big challenge not knowing proper terms in math!
There is a formula and it needs to get adjustable to so many bars back by a length input. I get very basic programming concepts. For example how do I add a length to a formula like “High – Low”. For a average true range? Let’s say I wanted to get the average true range for the last five bars? This is what I have now and need to adjust it….
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// Use this method for calculating your indicator values. Assign a value to each
double avgrange = (High[0] - Low[0]);
// plot below by replacing 'Close[0]' with your own formula.
RangePlot.Set(avgrange);
}
What or how do I write a average for this? I already have a length input but don’t know how to apply it.
Word!
Comment