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

Coding something weird...



PureBytes Links

Trading Reference Links

Hi everyone...

Okay, here it is; I want to code a moving average of the last x bars, 
except for a bar which actually passed through that ma. On that bar, I want 
the calculation to be on the point where the bar actually passed the ma. 
Meaning, on a 10 period ma, I`m following the market with 60min bars,ma 
being updated every tick. If the price is still under the ma, then the 
current ma value consists of the last 9 closes and the current price. But 
should the price actually touch this value, the ma would stop updating, and 
would for the next bar consist of 8 closes, 1 "touched" value, and the 
current price of that price. Is this feasible? Is this possible? Is this 
sane......?

Thanks in advance,

Philip