Trading system 1.1 point & figure
Forums › ProRealTime forum Italiano › Supporto ProOrder › Trading system 1.1 point & figure
- This topic has 12 replies, 2 voices, and was last updated 3 years ago by Gael.
Tagged: ao, awesome, Awesome Oscillator, figure, fractals, frattali, point, point & figure, renko
-
-
06/06/2021 at 9:41 AM #171228
Avrei un immenso favore da chiedervi, ovvero di tradurre queste idee in codice. Sto usando molto la piattaforma prorealtime, ma faccio ancora fatica a trascrivere le strategie in codice, spero possiate comprendermi.
Vi lascio in allegato il pdf con le idee di trading System.
Grazie in anticipo.
06/06/2021 at 10:09 AM #171239Piano piano si possono fare, in parte.
Renko è possibile, ma i mattoncini non sono quelli di ProrealTime, in quanto per le strategie si possono usare solo TF a tempo; qjuindi vanno adattati al tempo e non sono sempre identici, perchè tra una candela e l’altra non ci possono essere gli stessi Pips. Se vuoi avere un’dea di come sono costruiti e di strategie basta che cerchi RENKO sul forum utilizzando l’apposita casella di ricerca che si apre quando passi sopra il tuo avatar sulla barra blù in alto a destra. Inoltre, siccome ogni volta partono da barre iniziali diverse, i risultati dei backtest non sranno mai uguali.
Point & Figure non credo si possano simulare, non l’ho mai fatto.
Nei prossimi giorni ti farò sapere.
06/07/2021 at 11:29 AM #171329Quale indicatore di frattali usi?
06/07/2021 at 8:36 PM #17136206/07/2021 at 10:04 PM #171363Ci sono vari indicatori di frattali. Comunque userò quello che mi sembra migliore.
06/08/2021 at 10:34 AM #171382FRATTALI
————L’ho provato sul DAX (Daily, 1h, 30min TF’s); per il trailing stop ho usato il codice di Nicolas:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980// Frattali//// https://www.prorealcode.com/topic/trading-system-1-1///// basato sull'ndicatore://// https://www.prorealcode.com/prorealtime-indicators/bill-williams-fractals/)//DEFPARAM CumulateOrders = False//cp = 2 //2 (default)LH = 0LL = 0if high[cp] >= highest[2*cp+1](high) thenLH = 1endifif low[cp] <= lowest[2*cp+1](low) thenLL= -1endif//IF LL < 0 AND Not LongOnMarket THENBUY 1 CONTRACT AT MARKETELSIF LH > 0 AND Not ShortOnMarket THENSELLSHORT 1 CONTRACT AT MARKETENDIF//*********************************************************************************// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (righe 17- 56), with the addition of DISTANCE////trailing stop functiontrailingstart = 25 //20 trailing will start @trailinstart points profittrailingstep = 25 //25 trailing step to move the "stoploss"distance = 10 //10 pips distance from caurrent price (if required by the broker)//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 THENIF LongOnMarket THENIF (close + distance) > newSL THENSELL AT newSL STOPELSIF (close - distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnmarket THENIF (close + distance) < newSL THENEXITSHORT AT newSL STOPELSIF (close - distance) > newSL THENEXITSHORT AT newSL LIMITELSEEXITSHORT AT MarketENDIFENDIFENDIF//*********************************************************************************06/08/2021 at 2:10 PM #17139406/10/2021 at 3:41 PM #171585RENKO
———Provato sul DAX, 5 minuti:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091// Renko//// https://www.prorealcode.com/topic/initialising-renko-charts/#post-131050//once boxsize = 50 * pointsize //50once renkoMax = ROUND(close / boxSize) * boxSizeonce renkoMin = renkoMax - boxSizeIF close crosses over renkoMax + boxSize THENWHILE close > renkoMax + boxSizerenkoMax = renkoMax + boxSizerenkoMin = renkoMin + boxSizeBullish = 1Bearish = 0WENDELSIF close crosses under renkoMin - boxSize THENWHILE close < renkoMin - boxSizerenkoMax = renkoMax - boxSizerenkoMin = renkoMin - boxSizeBullish = 0Bearish = 1WENDENDIFIF Bullish AND Not LongOnMarket THENBUY 1 CONTRACT AT MARKETENDIFIF Bearish AND Not ShortOnMarket THENSELLSHORT 1 CONTRACT AT MARKETENDIF//*********************************************************************************// Nicolas'code (with the addition of DISTANCE)//// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (righe 17- 56)////trailing stop functionIF (BarIndex - TradeIndex) >= 0 THEN //0trailingstart = 25 //25 trailing will start @trailinstart points profittrailingstep = 25 //10 trailing step to move the "stoploss"distance = 10 //10 pips distance from caurrent price (if required by the broker)//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 THENIF LongOnMarket THENIF (close + distance) > newSL THENSELL AT newSL STOPELSIF (close - distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnmarket THENIF (close + distance) < newSL THENEXITSHORT AT newSL STOPELSIF (close - distance) > newSL THENEXITSHORT AT newSL LIMITELSEEXITSHORT AT MarketENDIFENDIFENDIFENDIF//*********************************************************************************1 user thanked author for this post.
06/11/2021 at 10:07 PM #17163406/16/2021 at 10:59 AM #171837Ecco il terzo (l’ho provato sul DAX, Giornaliero):
Heikin-Ashi + Awesome Oscillator1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889// HA & AO//// https://www.prorealcode.com/topic/initialising-renko-charts/#post-131050//// definizione Heikin-AshiONCE xOpen = openxClose = (Open + High + Low + Close) / 4IF BarIndex > 0 THENxOpen = (xOpen[1] + xClose[1]) / 2ENDIFBullish = xClose > xOpen //HA rialzistaBearish = xClose < xOpen //HA ribassista// definizione dell'Awesome OscillatorONCE FastMM = 5 //5 Fast AverageONCE SlowMM = 34 //34 Slow Average//AO = Average[FastMM,0](xClose) - Average[SlowMM,0](xClose) //AO con Heikin-AshiAO = Average[FastMM,0](close) - Average[SlowMM,0](close) //AO normaleBullAO = AO > AO[1] //AO rialzistaBearAO = AO < AO[1] //AO ribassista// entrtata LONGIF Bullish AND BullAO AND Not LongOnMarket THENBUY 1 CONTRACT AT MARKETENDIF// entrata SHORTIF Bearish AND BearAO AND Not ShortOnMarket THENSELLSHORT 1 CONTRACT AT MARKETENDIF//*********************************************************************************// Nicolas'code (with the addition of DISTANCE)//// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (righe 17- 56)////trailing stop functionIF (BarIndex - TradeIndex) >= 0 THEN //0trailingstart = 25 //25 trailing will start @trailinstart points profittrailingstep = 25 //10 trailing step to move the "stoploss"distance = 10 //10 pips distance from caurrent price (if required by the broker)//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 THENIF LongOnMarket THENIF (close + distance) > newSL THENSELL AT newSL STOPELSIF (close - distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnmarket THENIF (close + distance) < newSL THENEXITSHORT AT newSL STOPELSIF (close - distance) > newSL THENEXITSHORT AT newSL LIMITELSEEXITSHORT AT MarketENDIFENDIFENDIFENDIF//*********************************************************************************06/16/2021 at 2:44 PM #171873Ecco il quarto (provato sul DAX, h1):
Renko & Frattali123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106// Renko & Frattali//// https://www.prorealcode.com/topic/trading-system-1-1///DEFPARAM CumulateOrders = False//------------------------------------------------------------------------------------// frattalicp = 2 //2 (default)BullFractal = 0BearFractal = 0if high[cp] >= highest[2*cp+1](high) thenBullFractal = 1endifif low[cp] <= lowest[2*cp+1](low) thenBearFractal = 1endif//------------------------------------------------------------------------------------// Renko boxesonce boxsize = 50 * pointsize //50once renkoMax = ROUND(close / boxSize) * boxSizeonce renkoMin = renkoMax - boxSizeBullish = 0Bearish = 0IF close crosses over renkoMax + boxSize THENWHILE close > renkoMax + boxSizerenkoMax = renkoMax + boxSizerenkoMin = renkoMin + boxSizeBullish = 1WENDELSIF close crosses under renkoMin - boxSize THENWHILE close < renkoMin - boxSizerenkoMax = renkoMax - boxSizerenkoMin = renkoMin - boxSizeBearish = 1WENDENDIF//------------------------------------------------------------------------------------//IF BullFractal AND Bullish AND Not LongOnMarket THENBUY 1 CONTRACT AT MARKETELSIF BearFractal AND Bearish AND Not ShortOnMarket THENSELLSHORT 1 CONTRACT AT MARKETENDIF// uscita LongIF Bullish AND LongOnMarket THEN //uscire al primo mattoncino inverso dopo l'entrataSELL AT MarketENDIF// uscitaShortIF Bearish AND ShortOnMarket THEN //uscire al primo mattoncino inverso dopo l'entrataSELL AT MarketENDIF//*********************************************************************************// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (righe 17- 56), with the addition of DISTANCE////trailing stop functiontrailingstart = 25 //20 trailing will start @trailinstart points profittrailingstep = 25 //25 trailing step to move the "stoploss"distance = 10 //10 pips distance from caurrent price (if required by the broker)//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 THENIF LongOnMarket THENIF (close + distance) > newSL THENSELL AT newSL STOPELSIF (close - distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnmarket THENIF (close + distance) < newSL THENEXITSHORT AT newSL STOPELSIF (close - distance) > newSL THENEXITSHORT AT newSL LIMITELSEEXITSHORT AT MarketENDIFENDIFENDIF//*********************************************************************************06/16/2021 at 4:05 PM #171884Ecco il quinto ed ultimo codice (è la strategia scritta da verdi55 https://www.prorealcode.com/prorealtime-trading-strategies/point-figure-charts-automated-trading-system/, con qualche piccola modifica e l’aggiunta del trailing stop di Ncolas):
Point & Figure123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103//https://www.prorealcode.com/prorealtime-trading-strategies/point-figure-charts-automated-trading-system///defparam cumulateorders = false//ONCE n = 1 //Number of lotsONCE uptrend = 1ONCE downtrend = 1ONCE Boxsize = 20 //Box size//turnafternn = 4LowerBorderBox = round((close / Boxsize) - 0.5) * BoxsizeONCE DowntrendLow = LowerBorderBoxONCE UptrendHigh = LowerBorderBoxIf LowerBorderBox > LowerBorderBox[1] thenIf uptrend = 1 thendowntrend = 0ONCE DowntrendLow = LowerBorderBoxIf LowerBorderBox > UptrendHigh thenUptrendHigh = LowerBorderBoxendifendifIf downtrend = 1 and LowerBorderBox >= DowntrendLow + (turnafternn * Boxsize) thenUptrendHigh = LowerBorderBoxuptrend = 1downtrend = 0endifelsif LowerBorderBox < LowerBorderBox[1] thenIf downtrend = 1 thenuptrend = 0ONCE UptrendHigh = LowerBorderBoxIf LowerBorderBox < DowntrendLow thenDowntrendLow = LowerBorderBoxendifendifIf uptrend = 1 and LowerBorderBox <= UptrendHigh - (turnafternn * Boxsize) thenDowntrendLow = LowerBorderBoxuptrend = 0downtrend = 1endifendifIf uptrend = 1 and uptrend[1] = 0 AND Not LongOnMarket thenbuy n contracts at marketendifIf downtrend = 1 and downtrend[1] = 0 AND Not ShortOnMarket thensellshort n contracts at marketendifset stop ploss 50//*********************************************************************************// https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/// (righe 17- 56), with the addition of DISTANCE////trailing stop functiontrailingstart = 25 //20 trailing will start @trailinstart points profittrailingstep = 25 //25 trailing step to move the "stoploss"distance = 10 //10 pips distance from caurrent price (if required by the broker)//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 THENIF LongOnMarket THENIF (close + distance) > newSL THENSELL AT newSL STOPELSIF (close - distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnmarket THENIF (close + distance) < newSL THENEXITSHORT AT newSL STOPELSIF (close - distance) > newSL THENEXITSHORT AT newSL LIMITELSEEXITSHORT AT MarketENDIFENDIFENDIF//*********************************************************************************06/18/2021 at 11:03 AM #171974 -
AuthorPosts
Find exclusive trading pro-tools on