Di seguito, in formato testo, il codice del trading system Schaff presentato all’Algotrading Day 2013 di Banca Sella con Fabio Pacchioni. Il codice è in formato Easy Language di Tradestation2000, facilmente convertibile in Power Language per Multicharts o Tradestation9.
QUI la dispensa completa sullo Schaff Indicator.
La versione per Metatrader4 scaricatela QUI
{*************************************************
Description : This is the Schaff Trend Cycle function
Provided By : FX-Strategy.com (c) Copyright 1999
Per Multicharts/Tradestation
**************************************************}
[IntrabarOrderGeneration = false]
Inputs: Price( Close), TCLen(10), MA1(145), MA2(240);
Variables: XMac(0), Frac1(0), PF(0), PFF(0), Frac2(0), Factor(.5);
{Calculate a MACD Line}
XMac = MACD(c,MA1,MA2) ;
{1st Stochastic: Calculate Stochastic of a MACD}
Value1 = Lowest(XMac, TCLen);
Value2 = Highest(XMac, TCLen) – Value1;
{%FastK of MACD}
Frac1 = IFF(Value2 > 0, ((XMac – Value1) / Value2) * 100, Frac1[1]);
{Smoothed calculation for %FastD of MACD}
PF = IFF(CurrentBar<=1, Frac1, PF[1] + (Factor * (Frac1 – PF[1])));
{2nd Stochastic: Calculate Stochastic of Smoothed Percent FastD, ?PF?, above.}
Value3 = Lowest(PF, TCLen);
Value4 = Highest(PF, TCLen) – Value3;
{%FastK of PF}
Frac2 = IFF(Value4 > 0, ((PF – Value3) / Value4) * 100, Frac2[1]);
{Smoothed calculation for %FastD of PF}
PFF = IFF(CurrentBar<=1, Frac2, PFF[1] + (Factor * (Frac2 – PFF[1])));
{******************Buy and Sell Signals******************}
If PFF crosses above 99 then
begin
buy (“SchaffFC Long”) this bar at close;
end
else if PFF crosses below 1 then
begin
sellshort (“SchaffFC Short”) this bar at close;
end
else if PFF crosses below 99 then
begin
sell (“SchaffFC Sell”) this bar at close;
end
else if PFF crosses above 1 then
begin
buytocover (“SchaffFC Buy”) this bar at close;
end;
Ciao,
vorrei avere alcuni chiarimenti visto che tu usi Multicharts.
Sai per caso se Multicharts gira bene sul MacBook di Apple ?
Grazie,
Maurizio
Multicharts non gira su Mac ma è possibile aggirare la cosa usando sul MAC VMWARE e installando Multicharts sulla macchina virtuale. Le prestazioni sono analoghe a quelle che si avrebbero con multicharts installato direttamente su MAC