[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 263

 
Run >> :

你能告诉我如何画一个正方形或长方形而不把它画成背景,把它画成一个框架吗?

谢谢你

在对象属性列表中,将作为背景绘制的矩形属性设置为false。

ObjectSet( string name, OBJPROP_BACK, false) 。

但该对象将在图表之前被绘制。

 

编辑|删除

我很抱歉,也许是为了一个不合理的问题......。


我对指标缓冲器的使用有点慢....或者说,我还没有完全搞清楚这个指标本身......


如果可能的话,您能否告诉我如何参考BrainTrend2StopN指标?


我想检查一下当前条形图的开盘是否高于/低于指标值。

我从EA中用字符串访问该指标。


iCustom(NULL,0, "BrainTrend2StopN",CountBars, 1,0)

iCustom(NULL,0, "BrainTrend2StopN",CountBars, 0,0)

为零和第一个缓冲区分别为....

但是,专家顾问对这个字符串没有反应...


事先非常感谢。

附加的文件:
 
Morzh09 >> :

iCustom(NULL,0, "BrainTrend2StopN", CountBars,1,0)

iCustom(NULL,0, "BrainTrend2StopN", CountBars,0,0)

为零和第一个缓冲区分别为....

专家顾问对这个字符串没有反应...

请注意,你的指标中有两个外部参数。

外部int Simbol =119;

外部intBars=500。

你必须把它们都写在iCustom中。


iCustom(NULL,0,"BrainTrend2StopN", Simbol, CountBars, 0,0);

iCustom(NULL,0,"BrainTrend2StopN", Simbol, CountBars, 1,0);
 

辽宁省


非常感谢你。纠正了代码,现在我传递了两个参数,但不幸的是,当我用指标缓冲值调用Alert 时,我只得到了零....。


如果你有机会,能否告诉我如何处理它。

附加的文件:
bt1_1.mq4  10 kb
 

尝试

Alert("Buy signal",
      "  ",
      DoubleToStr(iCustom(NULL,0,"BrainTrend1StopN", Simbol, CountBars, EnableAlerts, SignalID,1,0),8),
      "   ", 
      DoubleToStr(iCustom(NULL,0,"BrainTrend1StopN", Simbol, CountBars, EnableAlerts, SignalID,0,0),8)
      );
 
请帮助我,程序员先生。我已经为此奋斗了一个星期,但没有任何效果,因为我不知道如何编程。你能写一个 跨越两个HMA的指标,并有箭头形式的指针吗?
附加的文件:
hma.mq4  4 kb
 

由于某些原因,不明白什么是转变,不想把箭头

#property indicator_chart_window
//#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Magenta // 12
#property indicator_color2 Blue // 26
#property indicator_color3 MediumBlue
#属性指标_color4 番茄
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1
#property indicator_width4 1
//---- 指标参数
外置 int FastHMA = 12;
外置 int SlowHMA = 26;
Extern inttern ExtmethodFastHMA=0; // MODE_SMA
Extern int int ExtmethodSlowHMA=0; // MODE_SMA
Extern int ExtpriceFastHMA=0; // PRICE_CLOSE
Extern int ExtpriceSlowHMA=0; // PRICE_CLOSE
外置 int ExtsdvigFastHMA=0;
外置 int ExtsdvigSlowHMA=0;
外部 bool EnableAlert=true。
extern string ExtSoundFileName = ""。
//----指示器缓冲区
双重PreHMA1[]。
双重PreHMA2[]。
双重CrossUp[]。
double CrossDown[]。
static int bBuy = 0;
static int bSell = 0;

//+------------------------------------------------------------------+
int pF, pS;

//+------------------------------------------------------------------+
//|自定义指标初始化功能
//+------------------------------------------------------------------+
int init()
{

//中间
SetIndexStyle( 0, DRAW_LINE )。
SetIndexStyle( 1, DRAW_LINE )。
// 信号
SetIndexStyle( 2, DRAW_ARROW, EMPTY )。
SetIndexArrow( 2, 233 )。
SetIndexStyle( 3, DRAW_ARROW, EMPTY )。
SetIndexArrow( 3, 234 )。

//---- 5个指标缓冲区的映射
SetIndexBuffer(0,PreHMA1)。
SetIndexBuffer(1,PreHMA2)。
SetIndexBuffer( 2,CrossUp )。
SetIndexBuffer( 3,CrossDown )。

IndicatorDigits( MarketInfo( Symbol(), MODE_DIGITS ));

//---- DataWindow和指标子窗口标签的名称
IndicatorShortName("HMA2("+FastHMA+", "+SlowHMA+")")。
SetIndexLabel( 0, "HMA("+FastHMA + ", " +SlowHMA + ")" + FastHMA )。
SetIndexLabel( 1, "HMA(" + FastHMA + ", " + SlowHMA+")" + SlowHMA )。
SetIndexLabel( 2, "Buy" )。
SetIndexLabel( 3, "Sell")。

pF = MathSqrt(FastHMA)。
pS = MathSqrt(SlowHMA)。

//---- 初始化完成
return(0);
}


//+------------------------------------------------------------------+
double WMA(int x, int p) {
return(iMA(NULL, 0, p, 0, MODE_SMA, PRICE_CLOSE, x+sdvig))
}


//+------------------------------------------------------------------+
//| 振荡器的移动平均线|
//+------------------------------------------------------------------+
int start()
{

bool bConditionUp。
{ bConditionDown;
双重范围。
双倍AvgRange。

int限制。
int counter。
int counted_bars=IndicatorCounted()。

//----,最后计数的条形图将被重新计算。
如果(counted_bars>0) counted_bars--。
limit=Bars-counted_bars。

//---- 准备HMA
for(int i=0; i<limit; i++) {
PreHMA1[i] = 2*WMA(i, FastHMA/2) - WMA(i, FastHMA)。
PreHMA2[i] = 2*WMA(i, SlowHMA/2) - WMA(i, SlowHMA)。

平均范围=0。
bConditionUp = 0。
bConditionDown = 0。
for ( counter = i; counter <= i + 9; counter++ ) {
AvgRange += MathAbs( High[ counter ] - Low[ counter ] ) 。
}
范围=AvgRange/10。
bConditionUp = (PreHMA1[i+1] >= PreHMA2[i+1] ) &&
(PreHMA1[i+2] <= PreHMA2[i+2] ) &&
(PreHMA1[i]>=PreHMA2[i]); // 向上交叉
bConditionDown = (PreHMA1[i+1] <= PreHMA2[i+1] ) &&
(PreHMA1[i+2] >= PreHMA2[i+2] ) &&
(PreHMA1[i]<=PreHMA2[i]); //向下交叉
如果 ( bConditionUp) {//
CrossUp[i+1] = PreHMA2[i+1]-Range * 0.75。
CrossDown[i+1] = EMPTY_VALUE。
bConditionDown = false。
}

如果 ( bConditionDown) {//
CrossDown[i+1] = PreHMA2[i+1]+Range * 0.75。
CrossUp[i+1] = EMPTY_VALUE。
bConditionUp = false。
}

if (!bConditionUp && !bConditionDown) {
CrossDown[i+1] = EMPTY_VALUE。
CrossUp[i+1] = EMPTY_VALUE。
}

如果(bConditionUp && !bBuy==1 && i==0 && EnableAlert){
bBuy = 1; // 设置购买标志
bSell = 0; // 重置标志为卖出
Alert (Symbol()," ",Period(), "M Achtung BUY"); // beep
if ( ExtSoundFileName != "" ) PlaySound( ExtSoundFileName )。
}
如果(bConditionDown && !bSell==1 && i==0 && EnableAlert){
bBuy = 0; // 设置购买标志
bSell = 1; // 重置卖出标志。
Alert (Symbol()," ",Period(), "M Achtung SELL"); // beep
if ( ExtSoundFileName != "" ) PlaySound( ExtSoundFileName )。
}
//评论("买入-"+bBuy+"\nSell-"+bSell)。
} // 为

//返回("0")。
}
//用于购买
// if (bBuy==0 && i < 1 && EnableAlert) {
///警告 (Symbol()," ",Period(), "M Achtung BUY "); //哔声
// 警报("Buy,",bBuy,",i," EnableAlert)。
// if ( ExtSoundFileName != "" ) PlaySound( ExtSoundFileName ) 。
// }

// 如果(bSell==0 && i < 1 && EnableAlert) {
///警告(Symbol()," ",Period(), "M Achtung SELL")。
//警报("卖出-",bSell," ",i," ",EnableAlert)。
// if ( ExtSoundFileName != "" ) PlaySound( ExtSoundFileName ) 。
// }

谁能告诉我我的错误是什么?

 
kurt >> :


谁能告诉我我的错误是什么?

首先,把代码放到一个可读的表格中,用标签表示嵌套的级别和SRC按钮

 

你好。


请帮助我理解教程中的信息功能https://book.mql4.com/ru/build/info,我已经有一个星期没有理解了,为什么没有出现它的信号?我的专家顾问完全来自教程,信息包括在里面。


我需要在我的图表中添加一个指标吗?我应该用什么来填充它?这个例子有一个空的指标,我想用我想要的东西来填充它。如何使它显示Inform()函数的信号?

 

看来,对我们这些新手来说,一个星期是最后期限,之后我们就去找你了))))。


从最近的帖子中得出结论...

原因: