mt4实时看股票,但切换股票时mt4指标不同步,请问如何解决?图
请老师指导,谢谢我购买了一个用mt4实时看国内股票的接口,是可以实时同步看,有一个问题就是:报价是同步的,就是指标不同步,每更换一个股票时mt4指标就是不同步更新,但是如果重新应用模板或是删除指标后重新加载指标,此时指标的值才是正确的.
如图所示,请帮忙分析一下,可以随时联系我开远程连线观看.
通过我二天的分析,初步发现原因是因为指标是采用了类似ima等以i开头的内置函数,可能内置函数都采用了IndicatorCounted这个函数,导致每次数据更新时没有全部计算一次k线.
我采用代码代替ima,且不用IndicatorCounted,每次全部计算所有的k线,的确能同步更新.现在我的问题是无法应用mt4的内置函数,要自己重新编写,这样太麻烦了.请老大帮想一下解决办法.
非常感谢!
测试ok的代码:
[*]#property indicator_separate_window
[*]#property indicator_color1 White
[*]#property indicator_level1 0
[*]double buf[];
[*]int init()
[*] {
[*] SetIndexBuffer(0,buf);
[*] SetIndexStyle(0,DRAW_LINE);
[*] return(0);
[*] }
[*]int start()
[*] {
[*] Comment(Symbol(),",",iFractals(Symbol(),0,0,0));
[*] for(int i=0; i2) pos=Bars-ExtCountedBars-1;
[*] //Print("201,pos=",pos,",",TimeToStr(TimeLocal()));
[*] while(pos>=ma_shift)
[*] {
[*] if(pos==Bars-2) re1=Close;
[*] re1=Close*pr+re1*(1-pr);
[*] pos--;
[*] }
[*] return(re1);}
复制代码
无法同步更新的代码:<div class="blockcode"><div id="code_qSt"><ol>#property indicator_separate_window
#property indicator_color1 White
#property indicator_level1 0
double buf[];
int init()
{
SetIndexBuffer(0,buf);
SetIndexStyle(0,DRAW_LINE);
return(0);
}
int start()
{
Template=popular.tpl
for(int i=0; i 晕死也不多加点分 你好 , 写过很多ea了, 请看我用户名, 加后可提供博客看看我的ea介绍 EA真的不靠谱..。
. 好人一个 #无语 加油站加油 就为赚分嘛 这个不可信,没有保险的保赚钱的软件 希望可以用些时间了~````
页:
[1]
2