Intraday Momentum Index
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Intraday Momentum Index
- This topic has 4 replies, 2 voices, and was last updated 6 years ago by Gianluca.
-
-
12/20/2018 at 12:16 PM #87513
Buongiorno e’ possibile avere questo indicatore già presente su altre piattaforme anche in PRT?
@nicolas @robertogozzi Grazie in anticipo.
Allego qualche link che spiega il funzionamento:
https://library.tradingtechnologies.com/trade/chrt-ti-intraday-momentum-index.html
http://www.traderpedia.it/wiki/index.php/Formula_Intraday_Momentum_Indicatorqui il codice preso da tradingview:
1234567891011121314151617181920//@version=2study("Intraday Momentum Indicator")// Get traditional OHLC valuestOpen = security(tickerid, 'D', open)tClose = security(tickerid, 'D', close)// InputsimiPeriod = input(defval = 14, title = "IMI Period Length", type = integer, minval = 1)//Calculate IMIimiGain = tClose > tOpen ? nz(imiGain[1]) + (tClose - tOpen) : 0 // Open Higher than Close, Gain dayimiLoss = tClose < tOpen ? nz(imiLoss[1]) + (tOpen - tClose) : 0 // Close Higher than Open, Loss dayimiGainSum = sum(imiGain,imiPeriod) // Sum total of all Gains in specified periodimiLossSum = sum(imiLoss, imiPeriod) // Sum total of all Loses in specified periodimiTotal = 100 * (imiGainSum / (imiGainSum + imiLossSum))plot (70, title = "Overbought", style = circles, color = green, transp = 10, join = true)plot(30, title = "Oversold", style = circles, color = red, transp = 30, join = true)plot(imiTotal, title = "Intraday Momentum Indicator", style = line, color = yellow, transp = 0) // Plot the indicator12/20/2018 at 12:31 PM #87514ho anche provato un poco a farlo ma senza riuscirci:
12345678910111213141516171819202122232425//@version=2//study("Intraday Momentum Indicator")// Get traditional OHLC valuestOpen = OpentClose = close// InputsimiPeriod = periodi//Calculate IMIif tClose > tOpen thenimigain=(imiGain[1]) + (tClose - tOpen)endif// Open Higher than Close, Gain dayif tClose < tOpen thenimiloss=(imiLoss[1]) + (tOpen - tClose)endif // Close Higher than Open, Loss dayimiGainSum = summation[imiPeriod](imiGain) =imiPeriod// Sum total of all Gains in specified periodimiLossSum = summation[imiPeriod](imiloss)=imiPeriod // Sum total of all Loses in specified periodimiTotal = 100 * (imiGainSum / (imiGainSum + imiLossSum))return imitotal12/20/2018 at 12:46 PM #87519Penso che dovrebbe essere codificato in questo modo:
12345678910111213141516171819202122232425262728293031//@version=2//study("Intraday Momentum Indicator")// Get traditional OHLC valuestOpen = dOpen(0)tClose = dclose(0)// InputsimiPeriod = 14if barindex>imiPeriod then//Calculate IMIif tClose > tOpen thenimigain=(imiGain[1]) + (tClose - tOpen)elseimigain=0endif// Open Higher than Close, Gain dayif tClose < tOpen thenimiloss=(imiLoss[1]) + (tOpen - tClose)elseimiLoss=0endif // Close Higher than Open, Loss dayimiGainSum = summation[imiPeriod](imiGain)// Sum total of all Gains in specified periodimiLossSum = summation[imiPeriod](imiloss)// Sum total of all Loses in specified periodimiTotal = 100 * (imiGainSum / (imiGainSum + imiLossSum))endifreturn imitotal,70,3012/20/2018 at 12:49 PM #87520L’indicatore che hai pubblicato usa il quotidiano Apri e Chiudi. Ma la formula originale usa invece il tempo corrente Apri e Chiudi, quindi in base a questo puoi cambiare le variabili con:
12tOpen = open//dOpen(0)tClose = close//dclose(0)praticamente simile a una RSI, ma invece di usare Close / Close [1], utilizza Open / Close
12/20/2018 at 3:12 PM #87526 -
AuthorPosts
Find exclusive trading pro-tools on