Versione lunga da versione corta
Forums › ProRealTime forum Italiano › Supporto ProOrder › Versione lunga da versione corta
- This topic has 4 replies, 2 voices, and was last updated 1 year ago by robertogozzi.
-
-
10/02/2023 at 4:23 PM #221957
Chiedo se si puo fare una versione lunga di questo (di seguito) codice di Balmora.
// Stop e target: Inserisci qui i tuoi stop di protezione e profit target
//————————————————————————-
// Main code : PacMan v2
//————————————————————————-
// PAC MAN v2 – PIP HUNTER
// EUR / USD (M15)
// By BALMORA74 19.05.2018 – Vonasi modifications 20-5-18DEFPARAM CumulateOrders = false
DEFPARAM Preloadbars = 4000MoneyManagement = 0 //0, 1or 2
RiskManagement = 0 //0 or 1
Capital = 10000
MinBetSize = 1
RiskLevel = 20Equity = Capital + StrategyProfit
IF MoneyManagement = 1 THEN
PositionSize = Max(MinBetSize, Equity * (MinBetSize/Capital))
ENDIFIF MoneyManagement = 2 THEN
PositionSize = Max(LastSize, Equity * (MinBetSize/Capital))
LastSize = PositionSize
ENDIFIF MoneyManagement <> 1 and MoneyManagement <> 2 THEN
PositionSize = MinBetSize
ENDIFIF RiskManagement THEN
IF Equity > Capital THEN
RiskMultiple = ((Equity/Capital) / RiskLevel)
PositionSize = PositionSize * (1 + RiskMultiple)
ENDIF
ENDIFPositionSize = Round(PositionSize*100)
PositionSize = PositionSize/100Cv2 = RSI[14](close) <= 28
Cv3 = 0
For i = 11 to 14 Do
IF average[8](STD[i](close)) >= STD[i](close[3]) THEN
Cv3 = 1
ENDIF
NEXTOKSHORT = cv2 and Cv3
IF OKSHORT then
Sellshort PositionSize CONTRACT at market
SET STOP pLOSS l//64
SET TARGET PPROFIT p// 25
ENDIF//EXIT ZOMBIE TRADE
IF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= 100 and close > TradePrice THEN
EXITSHORT AT MARKET
ENDIFGrazie
10/02/2023 at 6:20 PM #221959Eccolo:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788// Stop e target: Inserisci qui i tuoi stop di protezione e profit target//————————————————————————-// Main code : PacMan v2//————————————————————————-// PAC MAN v2 - PIP HUNTER// EUR / USD (M15)// By BALMORA74 19.05.2018 - Vonasi modifications 20-5-18DEFPARAM CumulateOrders = falseDEFPARAM Preloadbars = 4000l = 64p = 25MoneyManagement = 0 //0, 1or 2RiskManagement = 0 //0 or 1Capital = 10000MinBetSize = 1RiskLevel = 20Equity = Capital + StrategyProfitIF MoneyManagement = 1 THENPositionSize = Max(MinBetSize, Equity * (MinBetSize/Capital))ENDIFIF MoneyManagement = 2 THENPositionSize = Max(LastSize, Equity * (MinBetSize/Capital))LastSize = PositionSizeENDIFIF MoneyManagement <> 1 and MoneyManagement <> 2 THENPositionSize = MinBetSizeENDIFIF RiskManagement THENIF Equity > Capital THENRiskMultiple = ((Equity/Capital) / RiskLevel)PositionSize = PositionSize * (1 + RiskMultiple)ENDIFENDIFPositionSize = Round(PositionSize*100)PositionSize = PositionSize/100// SHORTCv2 = RSI[14](close) <= 28Cv3 = 0For i = 11 to 14 DoIF average[8](STD[i](close)) >= STD[i](close[3]) THENCv3 = 1ENDIFNEXTOKSHORT = cv2 and Cv3IF OKSHORT thenSellshort PositionSize CONTRACT at marketSET STOP pLOSS l//64SET TARGET PPROFIT p// 25ENDIF//EXIT ZOMBIE TRADEIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= 100 and close > TradePrice THENEXITSHORT AT MARKETENDIF// LONGCv4 = RSI[14](close) >= 72Cv5 = 0For i = 11 to 14 DoIF average[8](STD[i](close)) < STD[i](close[3]) THENCv5 = 1ENDIFNEXTOKLONG = cv4 and Cv5IF OKLONG thenBuy PositionSize CONTRACT at marketSET STOP pLOSS l//64SET TARGET PPROFIT p// 25ENDIF//EXIT LONG TRADEIF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= 100 and close < TradePrice THENSELL AT MARKETENDIF10/03/2023 at 9:33 AM #221980Grazie, gentilissimo.
10/19/2023 at 6:19 PM #222660Scusa mi sono accorto solo adesso che quello che hai fatto è lungo e corto, io però, volevo solo lungo, per aggiustarlo devo togliere le righe dalla 46 alla 66?
Grazie
10/19/2023 at 6:28 PM #222664Esatto, togli tutte quelle (o commentale).
-
AuthorPosts
Find exclusive trading pro-tools on