Buonasera,
Se sono sono troppo indiscreto vorrei sapere se qualcuno può aiutarmi in merito alla codifica della seguente strategia:
Partiamo da due indicatori
Supertrend dettato 10-1,5
SMA 50
Long Scenario:
Quando una candela chiude sopra la SMA50 e contestualmente Suprtrend gira positivo, si entra long con target 40 punti e stop 40 punti
Short Scenario
Quando una candela chiude sotto la SMA50 e contestualmente Supertrend gira in negativo, si entra short con target 40 punti e stop 40 punti
Mi piacerebbe anche eseguire dei test sulla strategia sopra descritta, filtrandola per fasce orarie:
Le ore in cui il set up sarebbe valido sono :
dalle 08:00 alle 11:00
dalle 15:00 alle 18:00
dalle 20:00 alle 22:00
Ringrazio anticipatamente chi vorrà rispondermi
Hard
Ecco:
TradeON = time >= 080000 and time <= 110000
//TradeON = time >= 150000 and time <= 180000
//TradeON = time >= 200000 and time <= 220000
myST = Supertrend[1.5,10]
Sma50 = average[50,0](close)
L1 = close > Sma50
S1 = close < Sma50
L2 = close CROSSES OVER myST
S2 = close CROSSES UNDER myST
IF L1 and L2 and Not OnMarket and TradeON THEN
BUY 1 Contract at Market
ENDIF
IF S1 and S2 and Not OnMarket and TradeON THEN
SELLSHORT 1 Contract at Market
ENDIF
Set Target pProfit 40
Set Stop pLoss 40
È impostato per il primo orario, per provare gli altri basta che metti le doppie barre dei commenti alla riga 1 e le togli alla 2, ecc…
Grazie Roberto per la tua gentilezza e disponibilità