论坛全局菜单下方 - exness285X70 - 韬客社区论坛全局菜单下方 - 荔枝返现285X70 - 韬客社区论坛全局菜单下方 - ThinkMarkets285X70 - 韬客社区论坛全局菜单下方 - TICKMILL 285X70 - 韬客社区
查看:894回复:1
草龙韬客社区韬客社区
注册时间2004-12-17
[MT4指标]Expected Volumes指标
韬客社区
楼主发表于:2014-07-28 01:35只看该作者倒序浏览
1楼 电梯直达
电梯直达
附图指标, mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 //+------------------------------------------------------------------+ //| Expected Volumes.mq4 | //| Copyright ? 2007, Amir Aliev | //| http://finmat.blogspot.com | //+------------------------------------------------------------------+ #property copyright \"Copyright ? 2007, Amir Aliev\" #property link \"http://finmat.blogspot.com\" //---- #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Blue //---- input parameters extern int hist_steps=100; // Number of observations extern int span=1; // Days to step back each time //---- buffers double ExtMapBuffer1; int sum; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicators SetIndexStyle(0, DRAW_HISTOGRAM); SetIndexBuffer(0,ExtMapBuffer1); //---- short_name=\"Expected volumes(\" + hist_steps + \")\"; IndicatorShortName(short_name); SetIndexLabel(0, short_name); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int rest=Bars - counted_bars; int j, k, u; //---- while(rest>=0) { if(Bars - rest < span * 23 * hist_steps) { ExtMapBuffer1[rest]=0; rest--; continue; } sum=0; j=0; k=0; u=0; while(j < hist_steps && k < Bars) { if(TimeHour(Time[rest+k])==TimeHour(Time[rest])) { u++; if(u==span) { u=0; j++; sum+=Volume[rest + k]; } k+=23; } k++; } ExtMapBuffer1[rest]=sum/hist_steps; rest--; } //---- return(0); } //+------------------------------------------------------------------+
TK29帖子1楼右侧xm竖版广告90-240
个性签名

阅尽天下指标
搬砖开始,始于2014

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
Pzxzx韬客社区韬客社区
注册时间2017-08-06
版权所有:韬客外汇论坛 www.talkfx.com 联络我们:[email protected]