Home › Forums › CDC Forums › Supporting Members Area — รวบรวมสูตร Downloads และระบบการเทรด › สูตร Candle Volume for Aminbroker
- This topic has 3 replies, 2 voices, and was last updated 3 years, 8 months ago by FastFourier.
Viewing 3 reply threads
-
AuthorPosts
-
-
31/12/2020 at 4:41 am #37782MondayDogParticipant
พอดีลองฝึกเขียนโค้ดตามที่อาจารย์ต้ำสอนครับ เลยลองหาสูตรในเน็ต มาผสมกับ CDC Action Zone ครับ
ตามที่คุณลุงสอนในคลิปนี้ครับขอบพระคุณมากครับ
-
31/12/2020 at 4:42 am #37783MondayDogParticipant
/*SetChartOptions(0,chartShowArrows|chartShowDates); GraphXSpace = 15; SetChartBkGradientFill( colorSkyblue ,colorRose); _N(Title = Date()+EncodeColor(colorBlack)+ " Edited by K.Riyashree"+ "Website: www.aflcode.in"+ EncodeColor(colorBlue)+" Free Code" +" Afl Name : EquiVolume or CandleVolume charts, On Amibroker " + EncodeColor(colorGreen) + " Open:"+ Open+" ,"+"High:"+High+" ,"+"Low:"+Low+" , "+"Close:"+Close );*/ ChartType = ParamList ( "Chart Type", "CandleVolume,EquiVolume" ); Plot( C, "", 39, styleBar | styleNoDraw ); Maxy = Status( "axismaxy" ); Miny = Status ( "axisminy" ); pxchartheight = Status ( "pxchartheight" ); pxchartbottom = Status( "pxchartbottom" ); pxchartwidth = Status ( "pxchartwidth" ); pxchartleft = Status( "pxchartleft" ); fvb = Status ( "firstvisiblebar" ); Lvb = Status ( "lastvisiblebar" ); function yConvert( Value ) { return pxchartbottom - floor( 0.5 + ( Value - Miny ) * pxchartheight / ( Maxy - Miny ) ); } MinVolume = LowestVisibleValue( Volume ); MinVolume = Max ( Minvolume, 1 ); //printf ( "Min Visibe Bar volume = %.f\n", Minvolume ); sigma = 0 ; for ( i = BarCount - 1 ; i > fvb - 1 ; i -- ) { ratio = Volume[i] / MinVolume; sigma += ratio; } //GfxSelectPen( colorBlack ); Space = 1; // space between candles visiblebars = Lvb - fvb + 1; totalspace = Visiblebars * space; unitpx = ( pxchartwidth - totalSpace ) / sigma; // pixel LastbarRatio = Volume [BarCount -1] / MinVolume; delta = unitpx * Lastbarratio / 2; start = pxchartleft + ( BarCount - fvb - 1 ) * pxchartwidth / Visiblebars + delta; Chg = C - O; // Basic Parameter Setup // Price = ParamField("Price",3); FastPrd = Param("Fast MA Period",12); SlowPrd = Param("Slow MA Period",26); for ( i = BarCount - 1 ; i >= fvb && start > 0 ; i -- ) { // From CDC Action ZOne Basic // // 21st April 2017 // // Main functions // Fast = EMA(Price,FastPrd); Slow = EMA(Price,SlowPrd); Bullish = Fast > Slow; Bearish = Fast < Slow; // Bar Colors // Green = Bullish AND Price[i] > Fast; Yellow = Bullish AND Price[i] < Fast AND Price[i] > Slow; Brown = Bullish AND Price[i] < Slow; Red = Bearish AND Price[i] < Fast; Aqua = Bearish AND Price[i] > Fast AND Price[i] < Slow; Blue = Bearish AND Price[i] > Slow; BarColor = IIf(Green,colorGreen,IIf(Yellow,colorYellow,IIf(Brown,colorOrange,IIf(Red,colorRed,IIf(Aqua,colorAqua,IIf(Blue,colorBlue,colorDefault)))))); //fillcolor = IIf ( Chg [i] > 0 , colorLime, colorRed ); fillcolor = IIf ( Chg [i] > 0 , colorWhite, BarColor[i] ); GfxSelectPen( BarColor[i] ); GfxSelectSolidBrush( fillcolor ); ////////////// ratio = Volume[i] / MinVolume; width = unitpx * ratio ; width = Min ( width , pxchartwidth / 5 ); // limit max bar width in pixel to chartwidh/5 if ( ChartType == "CandleVolume" ) { x = start - width / 2; } y1 = yConvert ( High[i] ); y2 = yConvert ( Low[i] ); if ( ChartType == "CandleVolume" ) { GfxMoveTo ( x, y1 ); GfxLineTo( x, y2 ); } x1 = start - width; x2 = start ; if ( ChartType == "CandleVolume" ) { y1 = yConvert ( Open[i] ); y2 = yConvert ( Close[i] ); } // Un-comment these to enable optimization // // Do not forget to set your own lower and upper limits // // Do not forget to comment the FastPrd and SlowPrd lines above // /* SlowPrd = Optimize("Slow MA Period",26,12,125,2); FastPrd = round(Optimize("Fast MA Period",0.1,0.1,0.6,0.05)*SlowPrd); */ Hgt = y2 - y1; if ( Hgt == 0 ) Hgt = 1; y2 = y1 + Hgt; GfxRectangle( x1, y1, x2, y2 ); start = x1 - Space; // printf ( "\n%.f\t %.f px" , i, hgt ); } Title = Charttype; RequestTimedRefresh( 1 ); SetChartOptions(0,chartShowArrows|chartShowDates);
-
31/12/2020 at 4:43 am #37784MondayDogParticipant
ผิดพลาดประการใด รบกวนชี้แนะด้วยครับ
ขอบพระคุณครับ
-
06/02/2021 at 9:51 pm #38227FastFourierParticipant
ลอง run แล้ว error นะครับ ขอคำแนะนำด้วยคับ
-
-
AuthorPosts
Viewing 3 reply threads
- You must be logged in to reply to this topic.