PureBytes Links
Trading Reference Links
|
I'm trying to get a report that will show me the average daily change
in price broken into positive and negative changes. This runs, but
I'm getting funny numbers that don't make sense. If I set the
backtesting settings to "daily," will that produce results based on
hourly data or will this analyze the base (minute) data? Is there an
easier way to do this? TIA
Chuck Dudek
Filter=Close>0;
NumColumns = 0;
PosChange=NegChange=PosN=NegN=0;
for( i = 1; i < BarCount; i++ )
{
Change[i]=C[i]-C[i-1];
if ( Change[i]>0)
{
PosChange=PosChange+Change[i];
PosN=PosN+1;
}
if ( Change[i]<0)
{
NegChange=NegChange+Change[i];
NegN=NegN+1;
}
}
AddColumn(PosChange/PosN,"APC");
AddColumn(NegChange/NegN,"ANC");
Also I can't figure out how to add buy/sell signals to my charts. I
tried this code (right out of the manual) and it works as far as
backtesting, but will not show the arrows. What am I doing wrong?
Buy=C>MA(C,10);
Sell=C<MA(C,10);
Short=Sell;
Cover=Buy;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low,
High ) );
|