Salve, qualche anima pia potrebbe tradurre questo TS di Multicharts in PRT?
Grazie
// EasyLanguage (TradeStation) / PowerLanguage (MultiCharts) code// EasyLanguage (TradeStation) / PowerLanguage (MultiCharts) code// basic code to play around with 🙂
// DAX, 5min time frame, default settings, exchange time
input: RangeMultiplier(0.95), BegTime(0900), EndTime(0955), CloseTime(2155), SkipDay(Friday), MyContracts(1);
variables: minSetup(0), maxSetup(0), slLong(0), slShort(0), daily_factor(false);
If Date <> Date[1] then begin maxSetup = 0; minSetup = 0;
daily_factor = absvalue(opend(1)-closed(1))<0.75*(highd(1)-lowd(1));end;
If daily_factor and Time >= BegTime and Time <= EndTime and Dayofweek(date) <> SkipDay and EntriesToday(date) = 0 then begin
If maxSetup = 0 then begin // do once @ BegTime maxSetup = HighD(0) + RangeMultiplier * (HighD(0) – LowD(0)); slLong = HighD(0); end;
Buy(“LEx”) MyContracts contracts Next Bar at maxSetup stop;
If minSetup = 0 then begin // do once @ BegTime minSetup = LowD(0) – RangeMultiplier * (HighD(0) – LowD(0)); slShort = LowD(0); end;
SellShort(“SEx”) MyContracts contracts Next Bar at minSetup stop;
end;
Sell(“LXx”) from entry(“LEx”) Next Bar at slLong stop;BuyToCover(“SXx”) from entry(“SEx”) Next Bar at slShort stop;
If Time >= CloseTime then begin Sell(“TimeLXx”) from entry(“LEx”) Next Bar market; BuyToCover(“TimeSXx”) from entry(“SEx”) Next Bar at market;end;
Setstopcontract;SetStopLoss(1000);SetExitOnClose;
Dove hai ricevuto questo codice? Qual è lo strumento e il tempo impiegato? Come sono finora i risultati della strategia? Grazie.
Un mio amico me lo ha dato. Lo strumento fimanziario e’ il Dax con TF 1h
Tu lo sai tradurre in Prt ?
Grazie
R05Participant
Veteran
Ciao prova a vedere questo link in fondo alla pagina sul commento di Andrea Unger, mi sembra simile, puoi verificare, per comodità te lo riporto
DEFPARAM FLATAFTER=215500 // replace closetime condition
RangeMultiplier=0.95
BegTime=090000
EndTime=095500
MyContracts=1
SkipDay=dayofweek<>5
if intradaybarindex=0 then
maxSetup = 0
minSetup = 0
dailyfactor = abs(dOpen(1)-dClose(1))<0.75*(dHigh(1)-dLow(1))
tradethisday=0
else
if barindex=tradeindex then
tradethisday=1
endif
endif
If dailyfactor and Time >= BegTime and Time <= EndTime and SkipDay and tradethisday=0 then
if maxSetup=0 then
maxSetup = dHigh(0) + RangeMultiplier * (dHigh(0) - dLow(0))
slLong=dHigh(0)
endif
if minsetup=0 then
minSetup = dLow(0) - RangeMultiplier * (dHigh(0) - dLow(0))
slShort = dLow(0)
endif
Buy mycontracts contract at maxSetup stop
Sell at slLong stop
SellShort mycontracts contract at minSetup stop
ExitShort at slShort stop
endif
If LongOnMarket then
Sell at slLong stop
elsif ShortOnMarket then
ExitShort at slShort stop
endif
set stop loss 1000
DAX 5 min automated trading by Andrea Unger
Grazie, visto le performance, non credo sia quello giusto, bisognerebbe tradurre il codìdice che ho postato…
comunque, grazie tante!!
dovrebbe seguire questa Equity