[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plot Calc Help



PureBytes Links

Trading Reference Links

At 11:34 PM -0400 7/1/99, Sanders, Jeff wrote:

>Calculate the PercentFactor by looking at the last 500 bars and allowing
>only 3% of the bars to fall outside (above/below) the channel.

>Couldn't we code a function that will use a loop to keep adjusting the
>channel until it is right?


The code you posted will plot a 200 day moving average and bands some
percentage of price on either side of it. This average will lag the price
by about 100 bars and be plotted back in time 100 bars.

So the plot will always be 100 bars after the most current bar which makes
me wonder what you are going to use it for, even if you could automatically
generate it. It dosn't seem as if it would be useful for anything except
making a pretty picture...

Back to your question. EasyLanguage starts at the first bar and runs your
code one on each bar, until the last bar is finished. If using real-time
data, it then waits for a new bar of data and runs the code on that bar as
soon as it arrives.

Thus, you could determine the value of PercentFactor based upon some past
number of bars and then use this value for the next bar. Then you could
redo the calculation including the new bar and use that value for the next
bar. etc. But to base the size of the bars on the complete data series, you
would need to be able to run through the bars twice, once to determine the
value for PercentFactor, then a second time to plot the data. This cannot
be done automatically but could be done by custom programming.

But before you try this, I think you should think through what you are
going to do with a channel that is drawn 100 bars after it could be used
for trading.

Bob Fulks



But before