Tradurre codice TS Multicharts in PRT
Forums › ProRealTime forum Italiano › Supporto ProOrder › Tradurre codice TS Multicharts in PRT
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by enzo_52.
-
-
09/18/2017 at 9:09 AM #46460
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;09/18/2017 at 12:48 PM #4649809/18/2017 at 2:14 PM #4650509/29/2017 at 1:36 PM #4781509/29/2017 at 2:50 PM #47822Ciao prova a vedere questo link in fondo alla pagina sul commento di Andrea Unger, mi sembra simile, puoi verificare, per comodità te lo riporto
123456789101112131415161718192021222324252627282930313233343536373839404142434445DEFPARAM FLATAFTER=215500 // replace closetime conditionRangeMultiplier=0.95BegTime=090000EndTime=095500MyContracts=1SkipDay=dayofweek<>5if intradaybarindex=0 thenmaxSetup = 0minSetup = 0dailyfactor = abs(dOpen(1)-dClose(1))<0.75*(dHigh(1)-dLow(1))tradethisday=0elseif barindex=tradeindex thentradethisday=1endifendifIf dailyfactor and Time >= BegTime and Time <= EndTime and SkipDay and tradethisday=0 thenif maxSetup=0 thenmaxSetup = dHigh(0) + RangeMultiplier * (dHigh(0) - dLow(0))slLong=dHigh(0)endifif minsetup=0 thenminSetup = dLow(0) - RangeMultiplier * (dHigh(0) - dLow(0))slShort = dLow(0)endifBuy mycontracts contract at maxSetup stopSell at slLong stopSellShort mycontracts contract at minSetup stopExitShort at slShort stopendifIf LongOnMarket thenSell at slLong stopelsif ShortOnMarket thenExitShort at slShort stopendifset stop loss 100010/01/2017 at 4:42 PM #4793910/06/2017 at 11:13 AM #48411 -
AuthorPosts
Find exclusive trading pro-tools on