The Grinder EUSD 1H con errore
Forums › ProRealTime forum Italiano › Supporto ProOrder › The Grinder EUSD 1H con errore
- This topic has 6 replies, 2 voices, and was last updated 5 years ago by ironshirow.
-
-
12/15/2018 at 9:20 PM #87197
Ciao a tutti,
ho questo codice preso dal sito e non riesco più a trovare la pagina da cui l’ho preso per cui devo chiedere aiuto a tutti voi.
Questo codice funziona in demo senza errori e l’ho preso e spostato su un altro account che ho aperto ma non posso farlo partire perchè compare l’errore in allegato.
il codice è lo stesso ma sul nuovo account non mi permette di lanciarlo.
Mi potete aiutare a trovare o chi l’ha postato oppure a risolvere l’errore?
Grazie
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667//-------------------------------------------------------------------------// Codice principale : The Grinder EUSD 1H//-------------------------------------------------------------------------// System parametersDEFPARAM CumulateOrders = FalseDEFPARAM PRELOADBARS = 2000DEFPARAM FLATBEFORE = 080000DEFPARAM FLATAFTER = 210000LimitEntryTime = 200000 //No Entries after this time// Divergence Indicator RSIignored, DRSI = CALL "Divergence RSI v3"[24,8,1,0]BullishDivergence = DRSI = 1BearishDivergence = DRSI = -1// Filter to avoid entries on a trend (Delayed Donchian Canal with a Margin)NotBearTrend = LOWEST[100](close[10]) < (close+((close*SafetyMargin)/100))NotBullTrend = HIGHEST[100](close[10]) > (close-((close*SafetyMargin)/100))SafetyMargin = 0.05// Conditions for Entry of Long PositionsIF BullishDivergence AND NotBearTrend AND OPENTIME<=LimitEntryTime THENBUY 1 CONTRACTS AT MARKETELSIF SHORTONMARKET AND ((CLOSE-TRADEPRICE)/TRADEPRICE)*100 > FlipPosition THEN// Change from short to long position when the FlipPosition Stop reached, because a trend is underwayBUY 1 CONTRACTS AT MARKETENDIF// Conditions for Entry of Short PositionsIF BearishDivergence AND NotBullTrend AND OPENTIME<=LimitEntryTime THENSELLSHORT 1 CONTRACTS AT MARKETELSIF LONGONMARKET AND ((CLOSE-TRADEPRICE)/TRADEPRICE)*100 < -FlipPosition THEN// Change from long to short position when the FlipPosition Stop reached, because a trend is underwaySELLSHORT 1 CONTRACTS AT MARKETENDIF// Loss, Profit and Flip StopsSET STOP %LOSS 2 // Not used because the Flip Stop is lower, just in case.SET TARGET %PROFIT 31.1FlipPosition = 1.0 // It this %Loss is reached the position turns in the opposite direction (Long->Short or Short->Long)// END123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475//-------------------------------------------------------------------------// Funzione : Divergence RSI v3//-------------------------------------------------------------------------/// Detector of divergences/// Version by TempusFugit based on an original idea of jose7674///The variable "N" is the number of bars backwards that we use to find a divergence///The variable "a" is the number of bars used to calculate RSI///The variable "b" is the number of bars checked backwards to detecte swing highs or lows///The variable "c" is the aditional increase/decrise in price required to get a divergenceDRSI = RSI[a](close)cero = 0////Searching for swing highs or lowsIF (BarIndex > 5+N) THENIF (DRSI[1]>DRSI AND DRSI[1]>highest[b](DRSI[2])) THENRSISwingHigh=DRSI[1]RSIPreviousSwingHigh=highest[N](DRSI)PriceSwingHigh=close[1]PricePreviousSwingHigh=Highest[N](close)ENDIFIF (DRSI[1]<DRSI AND DRSI[1]<lowest[b](DRSI[2])) THENRSISwingLow=DRSI[1]RSIPreviousSwingLow=lowest[N](DRSI)PriceSwingLow=close[1]PricePreviousSwingLow=lowest[N](close)ENDIF////Detecting Divergences between RSI and PriceIF(RSISwingHigh<RSIPreviousSwingHigh AND PriceSwingHigh>(PricePreviousSwingHigh[1]*(1+(c/100)))) THENsignal = -1ELSEsignal = 0ENDIFIF(RSISwingLow>RSIPreviousSwingLow AND PriceSwingLow<(PricePreviousSwingLow[1]*(1-(c/100)))) THENsignal = 1ENDIFENDIFReturn cero as "0", signal as "Divergence"/// If Divergence = 1, there is bullish divergence. if D =-1, bearish divergence///END12/15/2018 at 10:18 PM #87202- Please only use English in the English forum. I have moved your post to the Italian forum.
- Use the ‘Insert PRT Code’ button when putting code in your posts. I have tidied up your post.
- Si prega di utilizzare solo inglese nel forum inglese. Ho spostato il tuo post sul forum italiano.
- Utilizza il pulsante “Inserisci codice PRT” quando inserisci il codice nei tuoi post. Ho riordinato il tuo post.
12/15/2018 at 10:24 PM #87203What you have posted is one indicator and one strategy. The strategy calls the indicator. You are getting an error about RETURN if you are trying to write the indicator as a strategy.
Quello che hai postato è un indicatore e una strategia. La strategia chiama l’indicatore. Si sta verificando un errore su RETURN se si sta tentando di scrivere l’indicatore come strategia.
12/15/2018 at 10:51 PM #87204Grazie,
ma perchè funziona su un conto demo prorealtime?
Forse devo avere anche l’indicatore caricato?
Grazie
12/15/2018 at 11:07 PM #87206Forse devo avere anche l’indicatore caricato?
Yes of course. You cannot call an indicator that is not on your platform.
Sì, naturalmente. Non puoi chiamare un indicatore che non sia sulla tua piattaforma.
12/16/2018 at 11:02 AM #87213Ciao,
grazie ma l’indicatore che devo cercare è quello chiamato Divergence, giusto?
Ciao
12/16/2018 at 12:01 PM #87214Ciao,
ho risolto.
Grazie
-
AuthorPosts
Find exclusive trading pro-tools on