|
|
|
_SECTION_BEGIN("Wolfe Tool"); Wolfe=ParamToggle("Wolfe","OFF|ON",1); Type=ParamToggle("Label","PRICE|12345",1); Snap=ParamToggle("Snap","Yes|No",0); if(Wolfe==1) { SetBarsRequired( -2, -2 ); bi = BarIndex(); bis = SelectedValue( bi ); symbol = Name(); tframe = Interval(); chartID = GetChartID(); Xname = "X" + chartID + symbol + tframe; Yname = "Y" + chartID + symbol + tframe; LeftButton = GetCursorMouseButtons() & 1; a = Nz(StaticVarGet("counter")); if ( leftButton ) { StaticVarSet("counter", a+1); x = GetCursorXPosition( ); y = GetCursorYPosition( ); StaticVarSet( Xname + bis, x ); StaticVarSet( Yname + bis, y ); } j = 0; dt = DateTime(); shapePlot = 0; shapePos = Null; xx = yy = Null; FirstVisibleBar = Status( "FirstVisibleBar" ); Lastvisiblebar = Status( "LastVisibleBar" ); for ( i = FirstVisibleBar; i <Lastvisiblebar AND i<BarCount; i++ ) { x = StaticVarGet( Xname + i ); y = StaticVarGet( Yname + i ); if ( x == dt[i] AND snap==0) { shapePlot[i] = 1; shapePos[i] = IIf(abs(H[i]-y) < abs(L[i]-y), H[i], L[i]); xx[j] = i; yy[j] = IIf(abs(H[i]-y) < abs(L[i]-y), H[i], L[i]); j++; } else if ( x == dt[i] AND snap==1) { shapePlot[i] = 1; shapePos[i] = y; xx[j] = i; yy[j] = y; j++; } } shape = shapeSmallCircle; PlotShapes( shapePlot*shape, colorRed, 0, shapePos, 0 ); Values=ParamToggle("Segment Values","No|Yes",0); vr=ParamToggle("R1","No|Yes",1); for ( i = 1; i <= j ; i++ ) { if(i==1 AND Type==1) { PlotText("1 ",xx[i-1]-2,yy[i-1],colorBlue,colorLightGrey); } if(i==2 AND Type==1) { PlotText("2 ",xx[i-1]-2,yy[i-1],colorBlue,colorLightGrey); } if(i==3 AND Type==1) { PlotText("3 ",xx[i-1]-2,yy[i-1],colorBlue,colorLightGrey); } if(i==4 AND Type==1) { PlotText("4 ",xx[i-1]+2,yy[i-1],colorBlue,colorLightGrey); } if(i==5 AND Type==1) { PlotText("5 ",xx[i-1]+2,yy[i-1],colorBlue,colorLightGrey); } if(Type==0) { PlotText(""+yy[i-1],xx[i-1]+2,yy[i-1],colorWhite); } Plot( LineArray( xx[i-1], yy[i-1], xx[i], yy[i] ), "", colorYellow, styleLine|styleThick|styleNoRescale ); XA=yy[i]-yy[i-1]; AB=yy[i]-yy[i+1]; AD=yy[i]-yy[i+3]; BC=yy[i+1]-yy[i+2]; CD=yy[i+2]-yy[i+3]; r=CD/XA; r2=AB/XA; r3=XA/BC; if(i==4){ epa=LineArray(xx[i-4],yy[i-4],xx[i-1],yy[i-1],1); Plot(epa,"",colorRed,styleThick|styleNoRescale); } if(i==3){ epa=LineArray(xx[i-3],yy[i-3],xx[i-1],yy[i-1],1); Plot(epa,"",colorBlue,styleThick|styleNoRescale); } if(i==4){ epa=LineArray(xx[i-3],yy[i-3],xx[i-1],yy[i-1],1); Plot(epa,"",colorBlue,styleThick|styleNoRescale); } if(vr==1 AND i<4) { PlotText(""+Prec(abs(r2), 2 )+" ("+(abs(xx[i-1]-XX[i+1]))+")",XX[i-1]+int((xx[i+1]-XX[i-1])/2),yy[i-1]+((yy[i+1]-yy[i-1])/2),colorBlue,colorLightGrey); //Plot( LineArray( xx[i-1], yy[i-1], xx[i+1], yy[i+1] ), "", colorBlue, styleDashed ); } if(Values==1) { PlotText(""+Prec(abs(XA), 2 ),XX[i-1]+int((xx[i]-xx[i-1])/2),yy[i-1]+XA/2,colorBlue); } } if ( GetCursorMouseButtons() == 12 ) { for ( i = 0; i < BarCount; i++ ) { StaticVarRemove("counter"); StaticVarRemove( Xname + i ); StaticVarRemove( Yname + i ); RequestTimedRefresh(1,True ); } } } _SECTION_END();
_section_begin("wolfe tool"); wolfe=paramtoggle("wolfe","off|on",1); type=paramtoggle("label","price|12345",1); snap=paramtoggle("snap","yes|no",0); if(wolfe==1) { setbarsrequired( -2, -2 ); bi = barindex(); bis = selectedvalue( bi ); symbol = name(); tframe = interval(); chartid = getchartid(); xname = "x" + chartid + symbol + tframe; yname = "y" + chartid + symbol + tframe; leftbutton = getcursormousebuttons() & 1; a = nz(staticvarget("counter")); if ( leftbutton ) { staticvarset("counter", a+1); x = getcursorxposition( ); y = getcursoryposition( ); staticvarset( xname + bis, x ); staticvarset( yname + bis, y ); } j = 0; dt = datetime(); shapeplot = 0; shapepos = null; xx = yy = null; firstvisiblebar = status( "firstvisiblebar" ); lastvisiblebar = status( "lastvisiblebar" ); for ( i = firstvisiblebar; i <lastvisiblebar and i<barcount; i++ ) { x = staticvarget( xname + i ); y = staticvarget( yname + i ); if ( x == dt[i] and snap==0) { shapeplot[i] = 1; shapepos[i] = iif(abs(h[i]-y) < abs(l[i]-y), h[i], l[i]); xx[j] = i; yy[j] = iif(abs(h[i]-y) < abs(l[i]-y), h[i], l[i]); j++; } else if ( x == dt[i] and snap==1) { shapeplot[i] = 1; shapepos[i] = y; xx[j] = i; yy[j] = y; j++; } } shape = shapesmallcircle; plotshapes( shapeplot*shape, colorred, 0, shapepos, 0 ); values=paramtoggle("segment values","no|yes",0); vr=paramtoggle("r1","no|yes",1); for ( i = 1; i <= j ; i++ ) { if(i==1 and type==1) { plottext("1 ",xx[i-1]-2,yy[i-1],colorblue,colorlightgrey); } if(i==2 and type==1) { plottext("2 ",xx[i-1]-2,yy[i-1],colorblue,colorlightgrey); } if(i==3 and type==1) { plottext("3 ",xx[i-1]-2,yy[i-1],colorblue,colorlightgrey); } if(i==4 and type==1) { plottext("4 ",xx[i-1]+2,yy[i-1],colorblue,colorlightgrey); } if(i==5 and type==1) { plottext("5 ",xx[i-1]+2,yy[i-1],colorblue,colorlightgrey); } if(type==0) { plottext(""+yy[i-1],xx[i-1]+2,yy[i-1],colorwhite); } plot( linearray( xx[i-1], yy[i-1], xx[i], yy[i] ), "", coloryellow, styleline|stylethick|stylenorescale ); xa=yy[i]-yy[i-1]; ab=yy[i]-yy[i+1]; ad=yy[i]-yy[i+3]; bc=yy[i+1]-yy[i+2]; cd=yy[i+2]-yy[i+3]; r=cd/xa; r2=ab/xa; r3=xa/bc; if(i==4){ epa=linearray(xx[i-4],yy[i-4],xx[i-1],yy[i-1],1); plot(epa,"",colorred,stylethick|stylenorescale); } if(i==3){ epa=linearray(xx[i-3],yy[i-3],xx[i-1],yy[i-1],1); plot(epa,"",colorblue,stylethick|stylenorescale); } if(i==4){ epa=linearray(xx[i-3],yy[i-3],xx[i-1],yy[i-1],1); plot(epa,"",colorblue,stylethick|stylenorescale); } if(vr==1 and i<4) { plottext(""+prec(abs(r2), 2 )+" ("+(abs(xx[i-1]-xx[i+1]))+")",xx[i-1]+int((xx[i+1]-xx[i-1])/2),yy[i-1]+((yy[i+1]-yy[i-1])/2),colorblue,colorlightgrey); //plot( linearray( xx[i-1], yy[i-1], xx[i+1], yy[i+1] ), "", colorblue, styledashed ); } if(values==1) { plottext(""+prec(abs(xa), 2 ),xx[i-1]+int((xx[i]-xx[i-1])/2),yy[i-1]+xa/2,colorblue); } } if ( getcursormousebuttons() == 12 ) { for ( i = 0; i < barcount; i++ ) { staticvarremove("counter"); staticvarremove( xname + i ); staticvarremove( yname + i ); requesttimedrefresh(1,true ); } } } _section_end();
الكلمات الدلالية (Tags) |
للايمي, مؤشر, موجة, الذئب, اصلاحة, بروكر, يساعدنا, خطا, على |
أدوات الموضوع | |
تعليمات المشاركة |
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك
BB code is متاحة
الابتسامات متاحة
كود [IMG] متاحة
كود HTML معطلة
|