Trading system con Harsi
Forums › ProRealTime forum Italiano › Supporto ProOrder › Trading system con Harsi
- This topic has 4 replies, 2 voices, and was last updated 3 weeks ago by Iván.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
10/17/2024 at 7:59 PM #239166
Ciao. Vorrei provare un trading system basato sull’indicatore Harsi, che è già stato codificato (lo riporto sotto) e come indicatore funziona. Tuttavia se lo infilo in un trading system automatico non parte neppure il backtest, segnalando che la funzione da 5 valori invece che 6 . (boh ….) Magari qualche anima pia (Roberto Gozzi) che mi aiuta …
345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455// HARSI by JS le 02.10.2023 modifié 02.10.2023defparam calculateonlastbars = 150//variables:rsip=7smoothing=1halength=14rsihelp= RSI[rsip]((high+close+low+open)/4)//-50rsihelp2= RSI[halength]((high+close+low+open)/4)//-50closersi2= rsi[halength](close)//-50if barindex>0 thenopenrsi2=rsi[halength](close[1])//-50elseopenrsi2=rsi[halength](close)//-50endifrsihighraw2= rsi[halength](high)//-50rslowraw2= rsi[halength](low)//-50rsihigh2= max(rsihighraw2,rslowraw2)rsilow2=min(rsihighraw2,rslowraw2)haclose= (closersi2+openrsi2+rsihigh2+rsilow2)/4if barindex > halength+2 thenhaopen = ((haopen[1]*smoothing) +haclose[1])/(smoothing+1)elsehaopen = (closersi2 +openrsi2)/2endifhahigh= max(rsihigh2, max(haopen,haclose))halow = min(rsilow2 , min( haopen, haclose))if haclose > haopen thenr=0g=153b=153elser=238g=73b=73endifDRAWCANDLE(haopen, hahigh, halow, haclose) COLOURED(r,g,b) BORDERCOLOR(R,G,B)if barindex > rsip thenrsismoothed = (rsismoothed[1]+ rsihelp)/2elsersismoothed = rsihelpendifreturn rsismoothed as “RSI-Smoothed”, 20 as “20”, 30 as “30”, 70 as “70”, 80 as “80”10/18/2024 at 11:54 AM #239191Ciao. Lascia che ti faccia un esempio. Ora devi solo modificare le condizioni di input e output per quelle che desideri.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061// HARSI by JS le 02.10.2023 modifié 02.10.2023//variabili:rsip = 7smoothing = 1halength = 14rsihelp = RSI[rsip]((high+close+low+open)/4)closersi2 = rsi[halength](close)if barindex > 0 thenopenrsi2 = rsi[halength](close[1])elseopenrsi2 = rsi[halength](close)endifrsihighraw2 = rsi[halength](high)rslowraw2 = rsi[halength](low)rsihigh2 = max(rsihighraw2, rslowraw2)rsilow2 = min(rsihighraw2, rslowraw2)haclose = (closersi2 + openrsi2 + rsihigh2 + rsilow2) / 4if barindex > halength + 2 thenhaopen = ((haopen[1] * smoothing) + haclose[1]) / (smoothing + 1)elsehaopen = (closersi2 + openrsi2) / 2endifhahigh = max(rsihigh2, max(haopen, haclose))halow = min(rsilow2, min(haopen, haclose))if barindex > rsip thenrsismoothed = (rsismoothed[1] + rsihelp) / 2elsersismoothed = rsihelpendif//----- Strategia di trading -----//// Condizioni di entrata/uscita lungheyourConditionsOpenLong=rsismoothed crosses over 30yourConditionsCloseLong=rsismoothed crosses over 70if not longonmarket and yourConditionsOpenLong thenBUY 1 CONTRACT AT MARKETendifif longonmarket and yourConditionsCloseLong thenSELL AT MARKETendif// Condizioni di entrata/uscita corteyourConditionsOpenShort=rsismoothed crosses under 70yourConditionsCloseShort=rsismoothed crosses under 30if not shortonmarket and yourConditionsOpenShort thenSELLSHORT 1 CONTRACT AT MARKETendifif shortonmarket and yourConditionsCloseShort thenEXITSHORT AT MARKETendif10/18/2024 at 4:10 PM #23921410/18/2024 at 4:17 PM #23921510/22/2024 at 11:30 AM #239322 -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
Find exclusive trading pro-tools on
Similar topics: