100pezzi
Nuovo forumer
Incuriosito, ho provato a codificare questa tecnica di Aldrovandi x vt
a me non sembra granche ma se volete dare il vs contributo...
a me non sembra granche ma se volete dare il vs contributo...
Codice:
Var: strend;
var: PriceW(0),ShareW(0),Count(0),VolWAPValue(0),VolWAPVariance(0),value1,value2,value3,VolWAPSD(0);
if isfirstbarday then
d > d[1];
PriceW = 0;
ShareW = 0;
Count = -1;
Value1 = 0;
Value2 = 0;
VolWAPValue = 0;
endif;
PriceW = PriceW + (A * V);
ShareW = ShareW + V;
Count = Count + 1;
Value3 = 0;
if ShareW > 0 then VolWAPValue =(PriceW /ShareW);
endif;
beginfor (value1, 1, count);
Value2 = (V[Value1]/ShareW) * ((AvgPrice[Value1]-VolWAPValue)* (AvgPrice[Value1]-VolWAPValue));
Value3 = Value3 + Value2;
endfor;
VolWAPVariance = Value3;
VolWAPSD = Sqrt(VolWAPVariance);
strend = supertrend (c, 3, 2);
if crossover (c,STREND) and STREND<VolWAPValue then EnterLong(NextBar, atopen);endif;
if crossunder (c,STREND) and strend>VolWAPValue then EnterShort(NextBar, atopen);endif;
if positiondir=1 and barsince (c>(volwapvalue+(2*VolWAPSD)))>2 then Exitlong (bar, atclose);endif;
if positiondir=-1 and barsince (c<(volwapvalue-(2*VolWAPSD)))>2 then Exitshort (bar, atclose);endif;
if positiondir=1 and c<volwapvalue or c<strend then Exitlong (bar, atclose);endif;
if positiondir=-1 and c>volwapvalue or c>strend then Exitshort (bar, atclose);endif;
///PLOT///
plotchart(strend,0,green,solid,3);
PlotChart(volwapvalue, 0, black, solid, 1);
PlotChart((volwapvalue+(2*VolWAPSD)), 0, black, solid, 1);
PlotChart((volwapvalue-(2*VolWAPSD)), 0, black, solid, 1);