This is driving me crazy! If I declare it in Run(), then I get the error that it is not declared in ChannelSwing(), obviously because ChannelSwing() has to be listed before Run(). But I really don't understand why I should have to do that. ChannelSwing() is capable of plotting a series called Dot11High. But does this series disappear every time ChannelSwing() is called (every tick?) because it is local?

Maybe someone can write me the code for the simple trading rule below. The chart in my previous post shows the red line that indicates the limit entry level. Once I have a functioning basis I can expand it to my full trading idea....

The upper channel value has the formula:

Dot11High = ((Close + High + Low)/3) * 2 - Low

It's extrapolating the Low and average HLC to the next bar. Thus it is known and fixed when the new bar opens.

IF Yesterday's Dot11High is less then the previous day's Dot11High
THEN place a limit entry SELL order at yesterday's Dot11High.

Then for simplicity of this example, place a Stop and Target at 100 pips.

Thanks in advance to anyone who can do me this huge favour.