Visualizzazione post con etichetta prorealtime. Mostra tutti i post
Visualizzazione post con etichetta prorealtime. Mostra tutti i post

31/01/11

ind prorealtime

////////bdm volume
//p=4//////pp=15

calc=MoneyFlow[p](close)* Range[p]


///////////////////////////////////////////////
a=lowest[p](calc+low)
b=average[pp](a)
c=b/b[1]-1
d=highest[p](calc+high)
e=average[pp](d)
f=e/e[1]-1
return c*10000 coloured(255,0,0)as"bdmlowvol",f*10000 coloured(0,255,0)as "bdmhighvol",30as"su",-30as"giu"
///////////////////////////////////////////
///////commodity gilmore index
///////a=19  oppure 25
/////////b=18   oppure  28
////////////c=38  oppure  26

return (diplus[a]+diplus[b])-diplus[c]coloured(0,0,255)as"gilmorecorto",25COLOURED(255,0,0)as"25short",15COLOURED(0,255,0)as"15long",(diplus[a*2]+diplus[b*2])-diplus[c*2]coloured(0,0,100)as"gilmorelungo",20COLOURED(0,0,255)as"Centro"
///////////////////////////////////////////////
////stoc   sestetto
///p=10

piuAlto = HIGHEST[p](HIGH)
piuBasso = LOWEST[p](LOW)



oscillatore = (CLOSE - piuBasso) / (piuAlto - piuBasso) * 100





RETURN oscillatore  coloured(51,51,255)as"sestetto",45coloured(255,0,0)as" short",55coloured(0,255,0)as" long",10coloured(255,0,0)as"se ritesta buy",90coloured(0,255,0)as"se ritesta short",triangularaverage[round(p*0.618)](oscillatore)coloured(255,0,0)as"trigg"

///////////////////////////////////////

///////stocsestettoevolume
///p=10
piuAlto = HIGHEST[p](HIGH)
piuBasso = LOWEST[p](LOW)
oscillatore = (CLOSE - piuBasso) / (piuAlto - piuBasso) * 100
///////////////////////////////////////////
hilo= volume/range
opeclo= close-open
a= (exponentialaverage[2](hilo*opeclo))
piuAlto = HIGHEST[p](a)
piuBasso = LOWEST[p](a)
verde = (a- piuBasso) / (piuAlto - piuBasso) * 100





RETURN oscillatore COLOURED(51,50,250) as "sestettoblu",45coloured(255,0,0)as" 45short",55coloured(0,255,0)as"55 long",10coloured(255,0,0)as"10se ritesta buy",90coloured(0,255,0)as"90se ritesta short",verde  COLOURED(0,102,0) as "verdesestettovolumeaggiungicolore"
///////////////////////////////////////
////stop  volatilita
//////moltiplier=da2,5  a4

rang6= (highest[6]((high)[1]))-(lowest[6]((low)[1]))
rang7= ((rang6+range)/7)*moltiplier
stopshort=(lowest[7](close))+rang7
stoplong=(highest[7](close))-rang7
///////////////////////////////////////////////////////////


return ExponentialAverage[7](stopshort)coloured(255,0,0) as"stopshortsemplice",ExponentialAverage[7](stoplong)coloured(0,255,0) as"stoplongsemplice"
//////////////////////////////////

///////volume.system.force.index
return exponentialaverage[13](forceindex(close)),0
////////////////////////
/////////volume a moneyflow

a=MoneyFlow[p](close)*average[p](volume/range)
aa=MoneyFlow[pp](close)*average[pp](volume/range)

return a coloured(250,170,0)as "moneicorto",aa coloured(100,200,150) as"moneilungo",0 as"zero"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////volume.bost.rep.
/////////co=4
/////bostian
a=close+close-high-low
b=high-low
intens=a/b
bost=summation[co](intens)*volume
bostsu=0
if bost >0 then
    bostsu=bost
else
    bostsu=0
endif
bostgiu=0
if bost <0 then
    bostgiu=bost
else
    bostgiu=0
endif
lineabostsu=std [co*2] ( bostsu)
lineabostgiu=std [co*2] ( bostgiu)*-1
///////////////////////////////////////bostian///////////////
if bostsu>0 and bostsu>lineabostsu then
    signal=2
endif
if bostsu>0 and bostsu
    signal=1
endif
if bostgiu<0 and bostgiu
    signal=-2
endif
if bostgiu<0 and bostgiu>lineabostgiu then
    signal=-1
endif
////////////////////////////////////////////////////bostiansignal///////////////
///repulse/////////
rep=repulse[co](close)
repsu=0
if rep >0 then
    repsu=rep
else
    repsu=0
endif
repgiu=0
if rep  <0 then
    repgiu=rep
else
    repgiu=0
endif
linearepsu=std [co*2] (repsu)
linearepgiu=std [co*2] ( repgiu)*-1
///////////////////////////////////////////////////////repulse repnal/////
if repsu>0 and bostsu>linearepsu then
    repnal=2
endif
if repsu>0 and bostsu
    repnal=1
endif
if repgiu<0 and bostgiu
    repnal=-2
endif
if repgiu<0 and bostgiu>linearepgiu then
    repnal=-1
endif
/////////////////////////////////repulse repnal
////volume a punti
hilo= volume/range
opeclo= close-open
a= (exponentialaverage[co](hilo*opeclo))
baseper=(signal+repnal)
///////////////////////

repulsignal=(exponentialaverage[co*2](repulse[co](close)))*2
if repulsignal>6 then
    repulsignal=6
endif
if repulsignal<-6 then
    repulsignal=-6
endif
return baseper COLOURED(51,0,0) as "lineamarrone.repulse.bostian",0.5COLOURED(0,255,0)as"limitsopra0",-0.5COLOURED(255,0,0)as"limitsotto0",repulsignal coloured(255,0,0)as"linearossa media doppia del repulse",0coloured(0,0,255)as"equilibrio",4coloured(51,0,0)as"4",-4coloured(51,0,0)as"-4"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////stop.trendlinea
c1=high>high[1]
c2=high>high[2]
c3=high>high[3]
c4=high>high[4]
var1=low
var2=low
var3=low
var4=low
if c1 and c2 and c3 and c4 then
    trendlong=1
    trendshort=0
endif
if var1 and var2 and var3 and var4 then
    trendlong=0
    trendshort=-1
endif
if trendshort=-1 then
    if low
        linea=low
    else
        linea=linea[1]
    endif
endif
if trendlong=1 then
    if high>linea then
        linea=high
    else
        linea=linea[1]
    endif
endif

return linea
//////////////////////////////////////////////////////////////////////////

///////////////Trend Index
////y=20
//ONCE y = 20 // This value is also the horizon of time over which the prediction is made.  The larger y is, the larger the timeperiod over which we can interpret the indicatorIf there is a low trend index, there are too many reversals, or the price is stagnanting, so the price is not trendy.

Useful Applications :
High values of the trend index can be used to validate signals given by particular indicaters which are only valid in treding periods and not in trading ranges..
ONCE upTrend = 0
ONCE downTrend = 0
ONCE countHighs = 0
downTrendLength = 0
upTrendLength = 0
countUpTrends = 0 // Number of consecutive increasing bars
countDownTrends = 0 // Number of consecutive decreasing bars
countLows = 0
IF BarIndex > y+4 THEN
    FOR x=0 TO y
        IF Close[x]>Max(High[x+1],Min(High[x+2],Min(High[x+3],High[x+4]))) THEN
            countHighs = countHighs + 1
            upTrend = 1
        ELSE
            IF upTrend THEN
                upTrendLength = countHighs + upTrendLength
                countUpTrends = countUpTrends + 1
                countHighs = 0
                upTrend = 0
            ENDIF
        ENDIF
       
        IF Close[x]
            countLows = countLows + 1
            downTrend = 1
        ELSE
            IF downTrend THEN
                downTrendLength = countLows + downTrendLength
                countDownTrends = countDownTrends + 1
                countLows = 0
                downTrend = 0
            ENDIF
        ENDIF
    NEXT
   
    upTrendAvgLength = upTrendLength/countUpTrends // Average length of bullish trends
    downTrendAvgLength = downTrendLength/countDownTrends // Average length of bearish trends
    trendsAvgLength = (upTrendAvgLength+downTrendAvgLength)/2 // Average length of trending periods.
    trendingIndex = 1-(countDownTrends + countUpTrends)/y // Number of bullish and bearish trends.  The less there are in relation to the number of bars, the more trendy the value is aand the higher TrendingBars will be.
ELSE
    trendingIndex = undefined
    trendsAvgLength = undefined
ENDIF
IF BarIndex > 2*y THEN
    trendingIndexMMy = Average[y](trendingIndex)
ELSE
    trendingIndexMMy = undefined
ENDIF
IF trendsAvgLength THEN
ENDIF
RETURN trendingIndex COLOURED(255,0,0) AS "Trending index", trendingIndexMMy COLOURED(255,128,0) AS "Trending index MA(y)" //, trendsAvgLength AS "Trends average length"
//////////////////////////////////////////////////

/////////TrailingStop
//////p=10
// ---- script begin ----
//
// TrailingStop%
// JWK, 20091016

perc = p // input Trailing Loss % - median term: 5 - 10
longloss = high*perc/100
shortloss = low*perc/100

If high < shorttrail[1] and direction[1] = -1 then // staying short
    shorttrail = Min(shorttrail[1],low + shortloss)
    longtrail = Min(longtrail[1],high - longloss)
    plot = shorttrail
    direction = -1
elsif high > shorttrail[1] and direction[1] = -1 then // short stopped out, going long
    shorttrail = Max(shorttrail[1], low + shortloss)
    longtrail = high - longloss
    plot = longtrail
    direction = 1
elsif low > longtrail[1] and direction[1] = 1 then // staying long
    longtrail = Max(longtrail[1],high - longloss)
    shorttrail = Max(shorttrail[1], low + shortloss)
    plot = longtrail
    direction = 1
elsif low < longtrail[1] and direction[1] = 1 then // long stopped out, going short
    longtrail = Min(longtrail[1],high - longloss)
    shorttrail = low + shortloss
    plot = shorttrail
    direction = -1
else
    shorttrail = low + shortloss
    longtrail = high - longloss
    plot = longtrail
    direction = 1
endif

return plot AS "TrailStop%"

// ---- script end ----////////////////////////////////////////

////////////volumi.pos.e.neg.
////m=5
volpos=0
volneg=0
for n=m downto 1
   
    if close[n-1]=>open[n-1] then
        volpos=volpos+volume[n-1]
    elsif close[n-1]
        volneg=volneg-volume[n-1]
    endif
next
return volpos coloured(0,255,0) as "VOLUMI POSITIVI", volneg coloured(255,0,0) AS "VOLUMI NEGATIVI",0 as"zero",tema[m](volpos+volneg)as " trigger"

///////////////////////////////////////////////////////////////

////////////volume per punticum
a=volume/range
b=abs(open-close)
indi= a*b
if open
    volpi=indi*1
else
    volpi=indi*-1
endif

return cumsum(volpi)
////////////////////////////////////////////////////////////////////////////////////




 

28/09/10

momc

Ogni promessa è debito e quindi.....

Si devono creare le variabili: pds(50,50,1), divi(3,3,1), pdsn(50,50,1), x(1,5,1)

////////////////////////////////////////////////////////////////
///////////////NORMALIZED MOMENTUM TS ///////////////
////////////////////////////////////////////////////////////////

if x=1 then
selprice=open
elsif x=2 then
selprice=high
elsif x=3 then
selprice=low
elsif x=4 then
selprice=close
elsif x=>5 then
selprice=volume
endif

ratio=min(selprice,selprice[pds])/max(selprice,selprice[pds])

if selprice>selprice[pds] then
mom=((2-ratio)*100)-100
else
mom=((ratio)*100)-100
endif

momnorm=(mom-lowest[pdsn](mom))/(highest[pdsn](mom)-lowest[pdsn](mom))*100


if pdsn=1 then
momnorm=mom
endif

pdsmm=round(pds/divi)
MM=TimeSeriesAverage[pdsmm](momnorm)

signal=((momnorm crosses over mm)-(mm crosses over momnorm))

if signal=1 then
if shortonmarket then
EXITSHORT at market nextbaropen
endif
buy 20%CAPITAL at market NextBarOpen
endif
if signal=-1 then
if longonmarket then
sell at market nextbaropen
endif
sellshort 20%CAPITAL at market NextBarOpen
endif
///////////////////////////FINE////////////////////////////////

13/09/10

bettervolume con rsi

Nella versione con RSI avete anche la lettura contemporanea della forza presente sul mercato, questo tipo di RSI si adatta alla scala del volume automaticamente ma ho inserito i controlli per poterlo eventualmente regolare in altezza, è completamente configurabile:

Legenda variabili RSI con valori di default:

Oshift= 30 (è il periodo su cui si calcola la media di riferimento del volume, tale periodo riguarda solo il numero iniziale di barre del vostro grafico storico, cioè se scegliete 30 (default), si intendono le prime 30 barre, non le seguenti 30, percui se all'inizio del vostro storico il volume era particolarmente scarso basterà che aumentiate tale periodo.

Vshift= 5 (è il parametro che regola RSI in altezza sulla scala del volume

period=14 (periodo di calcolo per RSI)

RSIMinimo=20 (la soglia di ipervenduto)

RSIMassimo=80 (la soglia di ipercomprato)

applica a = chiusura (valore su cui si calcola RSI)

ed ecco i codici:

Versione Solo volumi:

/////////////////////////////////////////////
vv1=volume
vv2=range*volume
if range<>0 then
vv3=volume/range
endif
vv4=average[100](vv1)
if vv1=lowest[20](vv1) then
lowvol=vv1
else
lowvol=0
endif
if vv2=highest[20](vv2) then
climax=vv1
else
climax=0
endif
if vv3=highest[20](vv3) then
chum=vv1
else
chum=0
endif
if vv2=highest[20](vv2) and vv3=highest[20](vv3) then
chumclim=vv1
else
chumclim=0
endif
if vv3=lowest[20](vv3) then
lowchum=vv1
else
lowchum=0
endif
return vv1 coloured(0,204,204) as "volume",lowvol coloured(204,204,0) as "Low-V Low-R",climax coloured(255,0,0) as "climax High-V High-R",chum coloured(0,204,0) as "High-V Low-R",lowchum as "Low-V High-R",chumclim coloured(204,0,204) as "climax High-V Low-R",vv4 as "average"


//////////////////////////////////////////////////////////////////////

versione modificata con RSI

//////////////////////////////////////////////////////

REM Parametri: Oshift=30 Vshift=5 period=14 RSIMassimo=80 RSIMinimo=20

////////////////////////////////////////////////////
vv1=volume
vv2=range*volume
if range<>0 then
vv3=volume/range
endif
vv4=average[100](vv1)
if vv1=lowest[20](vv1) then
lowvol=vv1
else
lowvol=0
endif
if vv2=highest[20](vv2) then
climax=vv1
else
climax=0
endif
if vv3=highest[20](vv3) then
chum=vv1
else
chum=0
endif
if vv2=highest[20](vv2) and vv3=highest[20](vv3) then
chumclim=vv1
else
chumclim=0
endif
if vv3=lowest[20](vv3) then
lowchum=vv1
else
lowchum=0
endif

REM RSI

rialzo=MAX(0,Customclose-Customclose[1])
ribasso=MAX(0,Customclose[1]-Customclose)
mmRialzo=wilderaverage[period](rialzo)
mmRibasso=wilderaverage[period](ribasso)
RS=mmRialzo/mmRibasso
mioRSI=100-100/(1+RS)

avolume=average[Oshift](volume)

If Barindex
mioRSI2=undefined
else
avolume=avolume[1]
mioRSI2=((mioRSI/100)*Vshift)*avolume
endif

avRSI=average[period*2](mioRSI2)
mRSI=avolume*(Vshift/2)

mioMax=(RSIMassimo/100)
mioMin=(RSIMinimo/100)
RSImin=(avolume*Vshift)*mioMin
RSIMax=(avolume*Vshift)*mioMax




return vv1 coloured(0,204,204) as "volume",lowvol coloured(204,204,0) as "Low-V Low-R",climax coloured(255,0,0) as "climax High-V High-R",chum coloured(0,204,0) as "High-V Low-R",lowchum as "Low-V High-R",chumclim coloured(204,0,204) as "climax High-V Low-R",vv4 as "average", mioRSI2 as "RSI", avRSI as "Media RSI", RSImin as "Ipervenduto", mRSI as "RSI 50", RSIMax as "Ipercomprato"
Jolly Roger non è connesso   Rispondi citando
www.finanza.com
info.gif (242 byte)