TS Volume-Weighted Average

Da traderpedia.
Jump to navigation Jump to search

Trading System "Volume-Weighted Average"

Formula per Tradestation™:

INIZIO FORMULA

Type : Signal, Name : Volume-Weighted Average

Vars:
MaLen(9),
AvgVolume(0),
Turbo(0),
InvTurbo(0),
MaWeight(0),
TurboMA(0);

AvgVolume = Average(V, MaLen);
Turbo = (AvgVolume - Lowest(AvgVolume, MaLen)) / (Highest(AvgVolume, MaLen) - Lowest(AvgVolume, Malen));
InvTurbo = 1 - Turbo;

If MaLen > 2 Then MaWeight = (2 / (1 + MaLen)) Else MaWeight = 0.67;
TurboMA = TurboMA * InvTurbo + AvgPrice * Turbo;
If Date < 1000401 Then Begin

If MarketPosition = 0 and C < TurboMA and TurboMA < TurboMA [1] Then
Buy Tomorrow on Highest(High, 2) Stop;
End;

If MarketPosition = 1 and C < TurboMA Then Begin
ExitLong on Close;
ExitLong Tomorrow on EntryPrice * 0.96 Stop;
End;

If Date >= 1000401 Then Begin
If MarketPosition = 0 and C > TurboMA and TurboMA > TurboMA [1] Then
Sell Tomorrow on Lowest(Low, 2) Stop;
End;

If MarketPosition = -1 and C > TurboMA Then Begin
ExitShort on Close;
ExitShort Tomorrow on EntryPrice * 1.04 Stop;
End;


FINE FORMULA

Vedi anche: