如何编码? - 页 45

 

我不太明白,我试图让我的EA在所有蓝色时买入,在所有红色时卖出。Ea的开盘和收盘都不在正确的位置,我需要看一下。

double TML=iCustom(NULL,0, "TrendManager",TM_Period,TM_Shift,0,shift);

double TMS=iCustom(NULL,0, "TrendManager",TM_Period,TM_Shift,1,shift);

double hasOpen = iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,1,shift) 。

double hasClose = iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,0,shift) 。

double HeikenAshiOpen=iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,2,shift) 。

double HeikenAshiClose=iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,3,shift)。

double SDLL=iCustom(NULL,0, "Slope Direction Line",period,method,price,1,shift);

double SDLS=iCustom(NULL,0, "斜率方向线",周期,方法,价格,2,移位);

buysig=false;

sellsig=false;

closebuy=false;

closesell=false。

bool Long = TML && SDLL && HeikenAshiOpen < HeikenAshiClose && hasOpen < hasClose;

bool Short = TMS && SDLS && HeikenAshiOpen > HeikenAshiClose && hasOpen > hasClose;

buyysig = Long;

sellsig = Short;

closebuy=sellsig;

closesell=buysig。

附加的文件:
 

日子

我在这些主题中读了很多关于阿斯指标的文章,但我如何让Heiken_Ashi_Smoothed显示上升和下降趋势,这似乎比最初想象的困难得多,我是否需要创建4个变量,2个用于上升,2个用于下降,如下所示

double hasOpenLong=iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,1,shift) ;

double hasCloseLong=iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,3,shift) ;

double hasOpenShort=iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,0,shift) 。

double hasCloseShort=iCustom(NULL,0, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaPeriod2,2,shift) ;

任何帮助都将是巨大的

欢呼声

贝诺

 

变量存储

我有一个指标,在我的图表上的某些事件中创建对象(箭头)。

比方说,在1分钟的图表上出现了3个箭头,然后我点击5分钟,再回到1分钟.....,箭头就消失了!!

这是一个变量存储问题吗?这里有一些代码...

(above) extern int arrowCount = 1;

(if arrow should show)

ObjectCreate("Sniper ArrowDown"+arrowCount, OBJ_ARROW, 0, TimeCurrent(),Bid);

ObjectSet("Sniper ArrowDown"+arrowCount,OBJPROP_ARROWCODE,242);

ObjectSet("Sniper ArrowDown"+arrowCount, OBJPROP_COLOR,Red);

ObjectSet("Sniper ArrowDown"+arrowCount, OBJPROP_STYLE, STYLE_SOLID);

ObjectSet("Sniper ArrowDown"+arrowCount, OBJPROP_WIDTH, 1);

arrowCount++;

有什么想法吗?

 
dharsant:
明白了,谢谢你的帮助!!。

很高兴你能想出办法。

我只是抛出了一些想法,我不确定它们是否能起作用。

我的想法是这样的,所以声音只播放一次。

bool Play_Sound;

if ((latestestmain >= 0) && (latestmain < 0))

{

Play_Sound=true。

}

如果(Play_Sound==true)

{

PlaySound("alert2.wav")。

Play_sound=false;

}

也许?

 

谢谢你,Wolfe,我也是这么想的。

我最终使用了类似的东西,但使用的是一个数组!

很感谢你的时间,伙计。

如果有人能帮助我解决上面发布的新问题,我将不胜感激。

我想让它在某个事件中在我的图表上画出箭头,我可以做到这一点。

但不知何故,我存储和启动脚本的方式是错误的,因为当我点击改变时间段时,之前设置在图表上的箭头并没有留在那里(它们消失了)。

有什么想法吗?

 

每个特定时间内的交易代码?

需要帮助的代码?

以下是它的工作原理。

每个时间段(比方说凌晨3点至6点)或一天或一周只开一定数量的订单

即使在该时间段内产生了信号,也不会再开立其他交易。

 

这是我的EA,我把它称为 "深渊",因为这是我试图学习编码的地方。

我目前正在研究这个网站和MQL4 上的这两个错误:自动外汇交易、策略测试器和MetaTrader 网站的自定义指标

2007.10.24 21:22:24 1998.11.20 06:00 The Abyss GBPJPY,Daily:OrderSend错误130

2007.10.24 21:22:24 1998.11.20 06:00 The Abyss GBPJPY,Daily: OrderSend函数的参数6是无效的双数。

有谁能看看这段代码,并让我知道我做错了什么,以及我如何能解决它。

任何帮助都将是巨大的

欢呼声

贝诺

 
antone:
需要帮助的代码?

以下是它的工作原理。

每个时间段只开放一定数量的订单(比如说凌晨3点到6点),或者一天或一周。

即使它在该时间段内产生了一个信号,也不会再进行交易

有谁能帮助我吗?

例如,它只能在早上5点至10点交易一个订单,但可以在其他时间再次交易。

 

当在EA中使用icustom时,你如何确定使用哪些缓冲区和指数。例如,如果我试图从silvertrend指标或类似的指标中获得上升或下降趋势。 我可能没有使用正确的术语,但希望你能明白我的意思。

#property indicator_chart_window

#属性 indicator_buffers 2

#属性 indicator_color1 Blue

#属性 indicator_color2 红色

//---- 输入参数

Extern int RISK=3;

extern int SSP=9;

extern int CountBars=350;

//---- 缓冲区

double val1[];

double val2[];

//+------------------------------------------------------------------+

//|自定义指标 初始化函数|

//+------------------------------------------------------------------+

int init()

{

string short_name;

//---- 指标行

IndicatorBuffers(2);

SetIndexStyle(0,DRAW_HISTOGRAM,0,2);

SetIndexStyle(1,DRAW_HISTOGRAM,0,2);

SetIndexBuffer(0,val1);

SetIndexBuffer(1,val2)。

 

对于这个代码,它将是这样的。

使用的缓冲区是黑体的。缓冲区之后是移位。

iCustom(NULL,0,"silvertrend",RISK,SSP,CountBars,0,0);

[/CODE]

Or like this:

[CODE]

iCustom(NULL,0,"silvertrend",3,9,350,0,0);

尊敬的先生

凯乐