3 trading system
Forums › ProRealTime forum Italiano › Supporto ProOrder › 3 trading system
- This topic has 6 replies, 2 voices, and was last updated 3 years ago by Gael.
Viewing 7 posts - 1 through 7 (of 7 total)
-
-
01/11/2021 at 5:39 AM #157256
Salve a tutti, avrei un favore da chiedervi.
Postreste per favore tradurre queste tre idee di Trading System (Allegato) in codice per favore.
Sono a disposizione se non si capisce qualcosa dell’idea.
Vi ringrazio in anticipo.
Buona giornata
01/11/2021 at 8:07 AM #157261Cercherò di farteli, magari uno alla volta.
01/11/2021 at 11:01 AM #157291Ecco il primo:
Trading System 11234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283// Trading System 1//// https://www.prorealcode.com/topic/3-trading-system///DEFPARAM CumulateOrders = FALSE// definzizione candele Heikin-Ashionce xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))Bullish = xClose > xOpenBearish = xClose < xOpenUpperWick = xHigh - max(xOpen,xClose)LowerWick = min(xOpen,xClose) - xLow//MySAR = SAR[0.02,0.02,0.2]//// Entrata LONGIF Bullish AND (xClose CROSSES OVER MySAR) AND (LowerWick = 0) AND Not OnMarket THENBUY 1 Contract at MarketMyTS = (abs(MySAR - xOpen) / 2) / PipSizeENDIF// Entrata SHORTIF Bearish AND (xClose CROSSES UNDER MySAR) AND (UpperWick = 0) AND Not OnMarket THENSELLSHORT 1 Contract at MarketMyTS = (abs(MySAR - xOpen) / 2) / PipSizeENDIF//// Uscita da LONGIF LongOnMarket AND Bearish THENSELL at MarketENDIF// Uscita da SHORTIF ShortOnMarket AND Bullish THENEXITSHORT at MarketENDIF////*********************************************************************************// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (lines 17- 56)//// Nicolas' trailing stop functiontrailingstart = MyTS //trailing will start @trailinstart points profittrailingstep = MyTS //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF//*********************************************************************************01/11/2021 at 2:38 PM #157342Non so se avevi già letto il post sopra (Trading System 1), ma ti avviso che l’ho cambiato leggermente ed ho allegato il file ITF.
01/11/2021 at 2:43 PM #157348Ecco il secondo:
Trading System 2123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384// Trading System 2//// https://www.prorealcode.com/topic/3-trading-system///DEFPARAM CumulateOrders = FALSEONCE N = 3 //3 numero candele// definzizione candele Heikin-Ashionce xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))Bullish = xClose > xOpenBearish = xClose < xOpenUpperWick = xHigh - max(xOpen,xClose)LowerWick = min(xOpen,xClose) - xLow//MySAR = SAR[0.02,0.02,0.2]//// Entrata LONGIF Bullish AND (xClose CROSSES OVER MySAR) AND (LowerWick = 0) AND Not OnMarket THENBUY 1 Contract at MarketMyTS = (abs(MySAR - xOpen) / 2) / PipSizeENDIF// Entrata SHORTIF Bearish AND (xClose CROSSES UNDER MySAR) AND (UpperWick = 0) AND Not OnMarket THENSELLSHORT 1 Contract at MarketMyTS = (abs(MySAR - xOpen) / 2) / PipSizeENDIF//// Uscita da LONGIF LongOnMarket AND (BarIndex - TradeIndex) = (N - 1) THENSELL at MarketENDIF// Uscita da SHORTIF ShortOnMarket AND (BarIndex - TradeIndex) = (N - 1) THENEXITSHORT at MarketENDIF////*********************************************************************************// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (lines 17- 56)//// Nicolas' trailing stop functiontrailingstart = MyTS //trailing will start @trailinstart points profittrailingstep = MyTS //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF//*********************************************************************************01/11/2021 at 4:05 PM #157362Terzo ed ultimo:
Trading System 31234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889// Trading System 3//// https://www.prorealcode.com/topic/3-trading-system///DEFPARAM CumulateOrders = FALSE// definzizione candele Heikin-Ashionce xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))Bullish = xClose > xOpenBearish = xClose < xOpenUpperWick = xHigh - max(xOpen,xClose)LowerWick = min(xOpen,xClose) - xLow// ParabolicSARMySAR = SAR[0.02,0.02,0.2]// Donchian ChannelONCE p = 40 //periodi per il canale Donchianhh = highest[p](high)ll = lowest[p](low)UPsar = MySAR => hhDNsar = MySAR <= ll//// Entrata LONGIF Bullish AND (xClose CROSSES OVER MySAR) AND (LowerWick = 0) AND DNsar AND Not OnMarket THENBUY 1 Contract at MarketMyTS = (abs(MySAR - xOpen) / 2) / PipSizeENDIF// Entrata SHORTIF Bearish AND (xClose CROSSES UNDER MySAR) AND (UpperWick = 0) AND UPsar AND Not OnMarket THENSELLSHORT 1 Contract at MarketMyTS = (abs(MySAR - xOpen) / 2) / PipSizeENDIF//// Uscita da LONGIF LongOnMarket AND xHigh >= HH THENSELL at MarketENDIF// Uscita da SHORTIF ShortOnMarket AND xLow <= LL THENEXITSHORT at MarketENDIF////*********************************************************************************// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (lines 17- 56)//// Nicolas' trailing stop functiontrailingstart = MyTS //trailing will start @trailinstart points profittrailingstep = MyTS //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF//*********************************************************************************01/11/2021 at 6:00 PM #157380 -
AuthorPosts
Viewing 7 posts - 1 through 7 (of 7 total)
Find exclusive trading pro-tools on
Similar topics: