编码帮助 - 页 227

 
Air92:
你好,Mladen.You made the version this indicator.我想要求在这里单独制作移动平均线,就像其他指标的例子那样,如果可能的话。 谢谢。

空气92

不能这样做(已经使用了8个绘图缓冲区- metatrader 4不允许超过8个绘图缓冲区)。

 
mladen:
Air92 不能这样做(已经使用了8个绘图缓冲区 - metatrader 4不允许超过8个绘图缓冲区)。

好的,Mladen,我明白了,谢谢你。

 

你好,姆拉登。

你能不能把这个MACD MTF indi转换为EA,当MACD在任何3个Tf上为绿色时买入,当任何3个红色时卖出,关闭交易并在反向趋势上打开新的。

需要的设置:跟踪,平衡,亏损,在开盘或收盘时进场,魔数和批量大小。在较低的tf上,它工作得很好!我将非常感激。谢谢

附加的文件:
 

嗨,我在论坛上发现了一些有趣的东西。有这样一个软件,可以帮助预测下一个蜡烛的方向。我一直在研究这个mt4脚本,为它添加波动性,但不能。波动率将告诉我们价格的大小或将延伸多远。这个原理不是我的,我从某个地方复制的。这个脚本真的在工作。我希望像Codergurus和Mladin这样的程序员能看看这个脚本,它现在真的不好用。

#property indicator_chart_window

#属性 indicator_buffers 2

#属性 indicator_color1 Lime

#属性 indicator_color2 红色

#perty indicator_width1 4

#属性 indicator_width2 4

外部 bool Alerts = TRUE;

double CrossUp[];

double CrossDown[];

bool CrossedUp = false;

bool CrossedDown = false;

int SignalLabeled = 0; // 0:初始状态;1:向上;2:向下。

int upalert=false,downalert=false;

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

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

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

int init()

{

//---- 指标

SetIndexStyle(0,DRAW_ARROW, EMPTY);

SetIndexArrow(0,233);

SetIndexBuffer(0,CrossUp);

SetIndexStyle(1,DRAW_ARROW, EMPTY);

SetIndexArrow(1,234);

SetIndexBuffer(1,CrossDown);

//----

return(0);

}

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

//|自定义指标去初始化功能|

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

int deinit()

{

//----

//----

return(0);

}

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

//|自定义指标迭代函数|

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

int start(){

int limit,i,counter;

双倍pnow。

double p1,p2,p3,p4,p5,p6,p7,p8,p9,p10;

双SOT、SOT1、SOT2、SOT3、SOT4、SOT5、SOT6、SOT7、SOT8、SOT9、SOT10。

双SOTAV10。

双重SOTAV2。

双重Range, AvgRange;

int counted_bars=IndicatorCounted()。

//----,检查可能的错误

if(counted_bars<0) return(-1);

//---- 最后一个被计算的柱子将被重新计算。

如果(counted_bars>0) counted_bars--;

limit=Bars-counted_bars。

for(i = 0; i <= limit; i++) {

counter=i;

范围=0。

平均范围=0。

for (counter=i;counter<=i+12;counter++)

{

AvgRange=AvgRange+MathAbs(High[counter]-Low[counter])。

}

Range=AvgRange/10;

// 当前价格 Close 和 Open

double OpenPricenow = Open ;

double ClosePricenow = Close ;

double Volumenow = Volume ;

// 蜡烛1

double OpenPrice1 = Open ;

double ClosePrice1 = Close ;

double Volume1 = Volume ;

// 蜡烛2

double OpenPrice2 = Open ;

double ClosePrice2 = Close ;

double Volume2 = Volume ;

// 蜡烛3

double OpenPrice3 = Open ;

double ClosePrice3 = Close ;

double Volume3 = Volume ;

// 蜡烛4

double OpenPrice4 = Open ;

double ClosePrice4 = Close ;

double Volume4 = Volume ;

// 蜡烛5

double OpenPrice5 = Open ;

double ClosePrice5 = Close ;

double Volume5 = Volume ;

// 蜡烛6

double OpenPrice6 = Open ;

double ClosePrice6 = Close ;

double Volume6=Volume ;

// 蜡烛7

double OpenPrice7 = Open ;

double ClosePrice7 = Close ;

double Volume7 = Volume ;

// 蜡烛8

双重OpenPrice8 =Open ;

double ClosePrice8 =Close ;

double Volume8 =Volume;

// 蜡烛9

double OpenPrice9 = Open ;

double ClosePrice9 = Close ;

double Volume9 = Volume ;

// 蜡烛10

double OpenPrice10 =Open;

double ClosePrice10=Close;

double Volume10=Volume;

pnow =(ClosePricenow - OpenPricenow)。

SOT = (pnow / Volumenow)*10000;

p1=(ClosePrice1-OpenPrice1)。

SOT1= (p1 / Volume1) *10000。

p2 = (ClosePrice2 - OpenPrice2);

SOT2 =(p2/ Volume2) *10000。

p3 =(ClosePrice3 - OpenPrice3)。

SOT3=(p3/Volume3)*10000。

p4=(ClosePrice4 - OpenPrice4)。

SOT4=(p4/Volume4)*10000;

p5=(ClosePrice5 - OpenPrice5)。

SOT5=(p5/Volume5)*10000。

p6=(ClosePrice6 - OpenPrice6)。

SOT6=(p6/Volume6)*10000。

p7=(ClosePrice7 - OpenPrice7)。

SOT7 =(p7 / Volume7)*10000。

p8 =(ClosePrice8 - OpenPrice8);

SOT8=(p8/Volume8)*10000;

p9 =(ClosePrice9-OpenPrice9);

SOT9=(p9/Volume9)*10000。

p10 =(ClosePrice10 -OpenPrice10)。

SOT10 = (p10/Volume10)*10000;

SOTAV10=(SOT1+SOT2+SOT3+SOT4+SOT5+SOT6+SOT7+SOT8+SOT9+SOT10/100*10);

sotav2 = (sotav10*2);

如果((SOT>SOTAV2)&&(ClosePrice1<OpenPrice1)&&(ClosePricenow<OpenPrice1)){

CrossedUp = true;

CrossedDown= false;

}

否则

如果((SOT>SOTAV2)&&(ClosePrice1>OpenPrice1)&&(ClosePricenow>OpenPricenow)){

CrossedUp = false;

CrossedDown = true;

}

如果((CrossedUp==true)&&(SignalLabeled!=1)){

CrossUp=Low-Range*1.3;

如果(i<=2 && Alerts && !upalert)

{

Alert (Symbol()," ",Period()," M Price UP ")。

//SendMail("Buy "+Symbol(),")。

upalert=true。

downalert=false。

}

SignalLabeled = 1;

}

如果((CrossedDown == true) && (SignalLabeled != 2)) {

CrossDown = High + Range*1.3;

如果(i<=2 && Alerts && !downalert)

{

Alert (Symbol()," ",Period(), "M Price DOWN")。

//SendMail("Sell "+Symbol(),")。

downalert=true。

upalert=false。

}

SignalLabeled = 2;

}

}

return(0);

}

这就是这个软件的原理。

交易速度=单位时间内的(价格变化/成交量)。 =(开盘-收盘)/默认时期的交易量。

如果当前蜡烛的SoT大于所选时期平均SoT的两倍,那么下一个蜡烛将与当前蜡烛的方向相同。(我们的信号可以在当前蜡烛的收盘时给出)。

请注意。如果当前的蜡烛后面是相同颜色的2-3根蜡烛,则不会给出信号。举例来说。日期 E/J(Open) E/J(High) E/J(Low) E/J(Close) Volume(E/J) 方向 价格变化 速度 11/06/2012 03:56:00 102.456 102.456 102.429 102.429 96 DOWN -0.027 2.81 11/06/2012 03:57:00 102.429 102.429 102.398 102.413 158 DOWN -0.016 1.01 由于速度大于1.70(14支蜡烛的平均值),它预测下支蜡烛将下跌。这个指标可以做成速度表的样子,也可以只显示数字和蜡烛上的信号。我认为这对做出正确的决定有很大的帮助。这背后的理论是,每一次上涨或下跌都需要一个比现有力量更大的力量或惯性,所以只要我们看到或捕捉到这种额外的力量,我们就可以确定下一个蜡烛的方向和价值。

......................................................................................................................

 
Mastercash:
嗨,我在论坛上发现了一些有趣的东西。有这样一个软件,可以帮助预测下一个蜡烛的方向。我一直在研究这个mt4脚本,以添加波动性,但不能。这个原理不是我的,我是从某个地方复制的,这个脚本真的很有效,我希望像Codergurus和Mladin这样的程序员能看看这个脚本,它现在真的不好用,因为警报一直在收割和重绘。

#属性 indicator_chart_window

#属性 indicator_buffers 2

#属性 indicator_color1 Lime

#属性 indicator_color2 红色

#perty indicator_width1 4

#属性 indicator_width2 4

外部 bool Alerts = TRUE;

double CrossUp[];

double CrossDown[];

bool CrossedUp = false;

bool CrossedDown = false;

int SignalLabeled = 0; // 0:初始状态;1:向上;2:向下。

int upalert=false,downalert=false;

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

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

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

int init()

{

//---- 指标

SetIndexStyle(0,DRAW_ARROW, EMPTY);

SetIndexArrow(0,233);

SetIndexBuffer(0,CrossUp);

SetIndexStyle(1,DRAW_ARROW, EMPTY);

SetIndexArrow(1,234);

SetIndexBuffer(1,CrossDown);

//----

return(0);

}

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

//|自定义指标去初始化功能|

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

int deinit()

{

//----

//----

return(0);

}

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

//|自定义指标迭代函数|

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

int start(){

int limit,i,counter;

双倍pnow。

double p1,p2,p3,p4,p5,p6,p7,p8,p9,p10;

双SOT、SOT1、SOT2、SOT3、SOT4、SOT5、SOT6、SOT7、SOT8、SOT9、SOT10。

双SOTAV10。

双重SOTAV2。

双重Range, AvgRange;

int counted_bars=IndicatorCounted()。

//----,检查可能的错误

if(counted_bars<0) return(-1);

//---- 最后一个被计算的柱子将被重新计算。

如果(counted_bars>0) counted_bars--;

limit=Bars-counted_bars。

for(i = 0; i <= limit; i++) {

counter=i;

范围=0。

平均范围=0。

for (counter=i;counter<=i+12;counter++)

{

AvgRange=AvgRange+MathAbs(High[counter]-Low[counter])。

}

Range=AvgRange/10;

// 当前价格 Close 和 Open

double OpenPricenow = Open ;

double ClosePricenow = Close ;

double Volumenow = Volume ;

// 蜡烛1

double OpenPrice1 = Open ;

double ClosePrice1 = Close ;

double Volume1 = Volume ;

// 蜡烛2

double OpenPrice2 = Open ;

double ClosePrice2 = Close ;

double Volume2 = Volume ;

// 蜡烛3

double OpenPrice3 = Open ;

double ClosePrice3 = Close ;

double Volume3 = Volume ;

// 蜡烛4

double OpenPrice4 = Open ;

double ClosePrice4 = Close ;

double Volume4 = Volume ;

// 蜡烛5

double OpenPrice5 = Open ;

double ClosePrice5 = Close ;

double Volume5 = Volume ;

// 蜡烛6

double OpenPrice6 = Open ;

double ClosePrice6 = Close ;

double Volume6=Volume ;

// 蜡烛7

double OpenPrice7 = Open ;

double ClosePrice7 = Close ;

double Volume7 = Volume ;

// 蜡烛8

双重OpenPrice8 =Open ;

double ClosePrice8 =Close ;

double Volume8 =Volume;

// 蜡烛9

double OpenPrice9 = Open ;

double ClosePrice9 = Close ;

double Volume9 = Volume ;

// 蜡烛10

double OpenPrice10 =Open;

double ClosePrice10=Close;

double Volume10=Volume;

pnow =(ClosePricenow - OpenPricenow)。

SOT = (pnow / Volumenow)*10000;

p1=(ClosePrice1-OpenPrice1)。

SOT1= (p1 / Volume1) *10000。

p2 = (ClosePrice2 - OpenPrice2);

SOT2 =(p2/ Volume2) *10000。

p3 =(ClosePrice3 - OpenPrice3)。

SOT3=(p3/Volume3)*10000。

p4=(ClosePrice4 - OpenPrice4)。

SOT4=(p4/Volume4)*10000;

p5=(ClosePrice5 - OpenPrice5)。

SOT5=(p5/Volume5)*10000。

p6=(ClosePrice6 - OpenPrice6)。

SOT6=(p6/Volume6)*10000。

p7=(ClosePrice7 - OpenPrice7)。

SOT7 =(p7 / Volume7)*10000。

p8 =(ClosePrice8 - OpenPrice8);

SOT8=(p8/Volume8)*10000;

p9 =(ClosePrice9-OpenPrice9);

SOT9=(p9/Volume9)*10000。

p10 =(ClosePrice10 -OpenPrice10)。

SOT10 = (p10/Volume10)*10000;

SOTAV10=(SOT1+SOT2+SOT3+SOT4+SOT5+SOT6+SOT7+SOT8+SOT9+SOT10/100*10);

sotav2 = (sotav10*2);

如果((SOT>SOTAV2)&&(ClosePrice1<OpenPrice1)&&(ClosePricenow<OpenPrice1)){

CrossedUp = true;

CrossedDown= false;

}

否则

如果((SOT>SOTAV2)&&(ClosePrice1>OpenPrice1)&&(ClosePricenow>OpenPricenow)){

CrossedUp = false;

CrossedDown = true;

}

如果((CrossedUp==true)&&(SignalLabeled!=1)){

CrossUp=Low-Range*1.3;

如果(i<=2 && Alerts && !upalert)

{

Alert (Symbol()," ",Period()," M Price UP ")。

//SendMail("Buy "+Symbol(),")。

upalert=true。

downalert=false。

}

SignalLabeled = 1;

}

如果((CrossedDown == true) && (SignalLabeled != 2)) {

CrossDown = High + Range*1.3;

如果(i<=2 && Alerts && !downalert)

{

Alert (Symbol()," ",Period(), "M Price DOWN")。

//SendMail("Sell "+Symbol(),")。

downalert=true。

upalert=false。

}

SignalLabeled = 2;

}

}

return(0);

}

这就是这个软件的原理。

交易速度=单位时间内的(价格变化/成交量)。 =(开盘-收盘)/默认时期的交易量。

如果当前蜡烛的SoT大于所选时期平均SoT的两倍,那么下一个蜡烛将与当前蜡烛的方向相同。(我们的信号可以在当前蜡烛的收盘时给出)。

请注意。如果当前的蜡烛后面是相同颜色的2-3根蜡烛,则不会给出信号。举例来说。日期 E/J(Open) E/J(High) E/J(Low) E/J(Close) Volume(E/J) 方向 价格变化 速度 11/06/2012 03:56:00 102.456 102.456 102.429 102.429 96 DOWN -0.027 2.81 11/06/2012 03:57:00 102.429 102.429 102.398 102.413 158 DOWN -0.016 1.01 由于速度大于1.70(14支蜡烛的平均值),它预测下支蜡烛将下跌。这个指标可以做成速度表的样子,也可以只显示数字和蜡烛上的信号。我认为这对做出正确的决定有很大的帮助。这背后的理论是,每一次上涨或下跌都需要一个大于现有力量的力量或惯性,所以只要我们看到或捕捉到这种额外的力量,我们就可以确定下一个蜡烛的方向和价值。

......................................................................................................................

现金大师

在我看来,在对代码进行任何操作之前,需要进行一些运行时测试。一旦市场开盘,就会看到可以做什么。

 

你好

谁能帮我在这个脚本中添加一些代码。jarroo_level_picker.mq4

这个脚本在蜡烛的打开或关闭时画线,取决于我们是否把它放在一半的蜡烛下面或下面,我希望它也能在该蜡烛下面或下面画出小箭头,以便以后看到它是在哪个蜡烛上使用的。

先谢谢了。

附加的文件:
 
Andrewsurfer:
你好

谁能帮我在这个脚本中添加一些代码。jarroo_level_picker.mq4

这个脚本在蜡烛的打开或关闭时画线,取决于我们是否把它放在一半的蜡烛下面或下面,我希望它也能在蜡烛下面或下面画出小箭头,以便以后看到它是用在哪个蜡烛上。

请先谢谢你。

安德鲁瑟弗

试试这个版本。它没有添加一个箭头,但添加了一个与线的颜色相同的条形图,该条形图是用在哪个蜡烛上的。

附加的文件:
 
mladen:
Andrewsurfer 试试这个版本。它没有添加箭头,但添加了一个条形,其颜色与使用蜡烛的条形的线色相同。

我很抱歉,但我没有看到任何变化。它仍然只是蓝线,没有任何其他标志。

 
Andrewsurfer:
我很抱歉,但我没有看到任何变化。它仍然只有蓝线,没有任何其他标志。

有一个额外的行(如图所示),它是在你把脚本放在哪里的栏里产生的。

附加的文件:
v_line.gif  36 kb
 
mladen:
有一条额外的线(如图所示),它是在你把脚本放在哪里的酒吧里创建的

我在前台对MT4图表进行了错误的设置,现在可以工作了。

非常感谢。