编码帮助 - 页 200

 
alpha24:
是的,先生,但我不会编码,请帮我做。 谢谢。

alpha24

张贴在这里(使用了阿弗尔公式中的默认参数):https://www.mql5.com/en/forum/173404/page5

 

mladen,如果可以的话,我有一些请求。

我总是用20-30个点的利润进行剥头皮交易(5位数的经纪人),但由于我使用的是1分钟的图表,有时20-30个点的点值会骗过我,因为范围很小,所以如果你能做一个简单的指标来显示图表中的当前点值范围,我在下面的图片中向你展示我的意思,再次感谢

编辑:关于点位范围的数值有些错误,应该是170点。

附加的文件:
untitled.jpg  109 kb
 

大家好。

事实上,我已经在其他主题上发表了关于这个问题的帖子,但后来我发现这个主题似乎更适合我寻求帮助。 有谁能帮助我在这个指标的窗口警报出现时添加货币名称? 因为我开了很多货币对,所以很难知道这个指标是指哪一个。它只是在发生时告诉买入/卖出信号。

谢谢。

附加的文件:
 
forex_love:
尊敬的女士们、先生们:大家好!我是来自中国人民大学的王晓东。

事实上,我已经在其他主题上发表了关于这个问题的帖子,但后来我发现这个主题似乎更适合我寻求帮助。 有谁能帮助我在这个指标的窗口警报出现时添加货币名称? 因为我开了很多货币对,所以很难知道这个指标是指哪一个。它只是在发生时告诉买/卖信号。

谢谢。

Forex_love在你的第一篇帖子中把货币对 加入了警报。

 
mrtools:
Forex_love在你的第一个帖子中把货币对加入了警报。

它的工作......再次感谢mrtools......如果我是对的,这是第一个在当前酒吧的真/假选项和货币名称上有警报的bbstops指标......我搜索它,他们只有货币名称而没有在当前真/假选项上有警报,或者像我附上的那个在当前设置为真/假的警报但没有货币名称。

对于那些想尝试这个指标的人来说,mrtools在我的第一篇帖子中所说的不是我的上述帖子,而是我在其他主题上的帖子。

附加的文件:
 

Mladen,你能帮我纠正这个指标吗? 不要绘制线...

谢谢

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Red

extern int ROC_Period=24;

extern int RSI_Period=3;

extern int bars_to_calculate = 250;

extern bool flip_line_up_side_down = false;

extern double USD = 1.0, // weights

JPY = 1.0,

GBP = 1.0,

CHF = 1.0,

CAD = 1.0,

AUD = 1.0,

NZD = 1.0;

double BIAS = 0; // starting value for the first bar

//---- indicator buffers

double Index[];

double ROC[];

double RSIonROC[];

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

//| Custom indicator initialization function |

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

int init()

{

string name = "";

//---- indicator line

IndicatorShortName(name);

IndicatorBuffers(3);

SetIndexStyle(0,DRAW_LINE,EMPTY,EMPTY);

SetIndexBuffer(0,RSIonROC);

SetIndexLabel(0,NULL);

//----

return(0);

}

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

//| Calculates the relative change of symbol between bar i and i+1 |

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

double Sentinal(string symbol, int i = 0)

{

double a = iMA(symbol,0,1,0,0,4,i),

b = iMA(symbol,0,1,0,0,4,(i+1)),

move = a-b;

if(a==0||b==0)

{

if(i==0)

Print("Warning: No "+symbol+" data loaded.");

return(0);

}

double moveInPercent = 100*move/b;

return(moveInPercent);

}

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

int start()

{

// int iMax = Bars - 1 - IndicatorCounted();

int iMax = Bars -1 ;

if(iMax >= bars_to_calculate)

{

iMax = bars_to_calculate;

}

Index = BIAS;

//----

for(int i = iMax; i >= 0; i--)

{

double x = 0;

x += USD * Sentinal("EURUSD",i);

x += JPY * Sentinal("EURJPY",i);

x += GBP * Sentinal("EURGBP",i);

x += CHF * Sentinal("EURCHF",i);

x += CAD * Sentinal("EURCAD",i);

x += AUD * Sentinal("EURAUD",i);

x += NZD * Sentinal("EURNZD",i);

if (flip_line_up_side_down)

x *= -1;

Index = Index+x;

ROC=iClose(Index,0,i)-iClose(Index,0,i+ROC_Period);

RSIonROC=iRSIOnArray(ROC,Bars,RSI_Period,i);

}

return(0);

}

 
k3rn3l:
Mladen,你能帮我改正这个指标吗? 不要画线...

谢谢

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Red

extern int ROC_Period=24;

extern int RSI_Period=3;

extern int bars_to_calculate = 250;

extern bool flip_line_up_side_down = false;

extern double USD = 1.0, // weights

JPY = 1.0,

GBP = 1.0,

CHF = 1.0,

CAD = 1.0,

AUD = 1.0,

NZD = 1.0;

double BIAS = 0; // starting value for the first bar

//---- indicator buffers

double Index[];

double ROC[];

double RSIonROC[];

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

//| Custom indicator initialization function |

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

int init()

{

string name = "";

//---- indicator line

IndicatorShortName(name);

IndicatorBuffers(3);

SetIndexStyle(0,DRAW_LINE,EMPTY,EMPTY);

SetIndexBuffer(0,RSIonROC);

SetIndexLabel(0,NULL);

//----

return(0);

}

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

//| Calculates the relative change of symbol between bar i and i+1 |

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

double Sentinal(string symbol, int i = 0)

{

double a = iMA(symbol,0,1,0,0,4,i),

b = iMA(symbol,0,1,0,0,4,(i+1)),

move = a-b;

if(a==0||b==0)

{

if(i==0)

Print("Warning: No "+symbol+" data loaded.");

return(0);

}

double moveInPercent = 100*move/b;

return(moveInPercent);

}

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

int start()

{

// int iMax = Bars - 1 - IndicatorCounted();

int iMax = Bars -1 ;

if(iMax >= bars_to_calculate)

{

iMax = bars_to_calculate;

}

Index = BIAS;

//----

for(int i = iMax; i >= 0; i--)

{

double x = 0;

x += USD * Sentinal("EURUSD",i);

x += JPY * Sentinal("EURJPY",i);

x += GBP * Sentinal("EURGBP",i);

x += CHF * Sentinal("EURCHF",i);

x += CAD * Sentinal("EURCAD",i);

x += AUD * Sentinal("EURAUD",i);

x += NZD * Sentinal("EURNZD",i);

if (flip_line_up_side_down)

x *= -1;

Index = Index+x;

ROC=iClose(Index,0,i)-iClose(Index,0,i+ROC_Period);

RSIonROC=iRSIOnArray(ROC,Bars,RSI_Period,i);

}

return(0);

}

k3rn3l

试试附件中的测试指标。没有解决的问题是,你想用索引缓冲区达到什么目的?你不能以这种形式使用它:iClose(Index,0,i)(Index被声明为双数,而iClose在该参数处期待字符串)。现在可以画出数值了,但你需要在代码中再做一些清理。

附加的文件:
_test.mq4  3 kb
 

大家好!谁能为 "商品选择指数 "编码?

这里的公式(http://www.indicatorsmt4.com/indicators-wiki/trend-indicators/commodity-selection-index-csi/?lang=it)

该指标有助于识别波动性和范围市场。

 
Luca82:
大家好!谁能为 "商品选择指数 "编码?

这里的公式(http://www.indicatorsmt4.com/indicators-wiki/trend-indicators/commodity-selection-index-csi/?lang=it)

该指标有助于识别波动性和范围市场。

Luca82

Metatrader没有计算该指标所需的所有数据

即使在那个链接上,显示的例子也不是metatrader的例子。

 

能否让图表中的箭头上升(Fx MTN)?需要帮助

你好,我想问一下,是否有可能重写这个指标,使其只显示箭头,而箭头应该显示在蜡烛图上?谁能帮我一下,或者帮我编码一下?

问候

慢速

fxmtn-test.mq4

附加的文件: