问吧! - 页 52

 
pawang:

2.)根据第1点,真正的情况是......如何创造一个看涨/看跌的背离?

当有条件时。 在确定的时间框架内,有一个最高的价格和最高的RSI。然后在时间运行后......我们遇到了一个新的最高价格,但没有跟随新的RSI的高点(RSI未能创出新高)。

//this gives you highest/lowest prices on last 10 bars starting with current(last on the graph - zero bar)

double highestPrice = High;

double lowestPrice = Low;

/*

this gives you lowest/highest rsi on last 10 bars starting with current - 0 bar

*/

double lowestRSI=9999, highestRSI=-9999;

int currentBar = 0;

int endBar = 10;

for(currentBar=0; currentBar<endBar; currentBar++) lowestRSI = MathMin(lowestRSI, iRSI(Symbol(),0,14,PRICE_CLOSE,currentBar));

for(currentBar=0; currentBar<endBar; currentBar++) highestRSI = MathMax(lowestRSI, iRSI(Symbol(),0,14,PRICE_CLOSE,currentBar));

//starting at bar #10 you go back 10 bars on the chart looking for lowest price

//thus you'll get lowest price from bar #10 to bar #20

double lowestPrice10_20 = Low;

to get divergence, you'll need to compare rsi & price over periods

if(lowestPrice10_20 lowestRSI){

//on bars 10-20 lowest rsi is higher than on bars 0-10

//on bars 10-20 lowest price is lower than on bars 0-10

//i hope thats correct

}

你需要开始看mql4.com的文档和这个论坛,大部分信息都涵盖了

 

我怎样才能写出这个EA?

我怎样才能写出这个EA:

1 - 在价格+20处开一个StopBuy 0.01,在价格-20处开一个StopSell 0.01,TP 20。

2 - 如果一个订单被执行,取消另一个。

3 - 如果已执行的订单是买入订单,在入市价格-20处反向卖出1个StopSell双倍(0.02),如果是卖出订单,则相反。

4 - 每次执行止损单时,将双倍价格倒退20点,直到TP被执行。

谢谢你的帮助。

 

试试这个,我在上面放了一个警报,很好。

附加的文件:
ifish.mq4  3 kb
 

有谁能帮我写代码

有谁能帮助我,如何对过期的指标进行编码,使指标能够运行......以及如何对指标进行编码,使它只能在一个账户ID下运行。

谢谢

 
increase:
试试这个,我在上面放了一个警报,很好。

非常感谢,它像魔法一样发挥作用,是否有可能制作一个EA,当出现破位时在相反方向下单,目标只有5点?

 

每个指标的声音提示

我们是否可以改变每个指标的声音警报,如果可以,如何?

 

EA不能在正向测试中工作

亲爱的Codersguru。

能否请您帮忙看看我下面的EA。它在回溯测试 中工作得非常好,但在真实的模拟交易账户中却不行。交叉后没有任何买入或卖出动作。非常感谢您。

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

//| 5/13-v2-SOS.mq4

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

外部int Unique_Ref_Number=513;

extern int TakeProfit = 5;

extern int StopLoss=5;

外置双数 Lots = 1;

extern int Max_Contracts = 1;

Extern int emaShortPeriod=5;

extern int emaLongPeriod=13;

外部 bool MoneyManagement=true;

外部int Risk=2。

int init() { return(0); }

int deinit() { return(0); }

int Crossed()

{

double emaLong_1=iMA(NULL,0,emaLongPeriod,0,1,PRICE_CLOSE,2);

double emaLong=iMA(NULL,0,emaLongPeriod,0,1,PRICE_CLOSE,1);

double emaShort_1=iMA(NULL,0,emaShortPeriod,0,1,PRICE_CLOSE,2);

double emaShort=iMA(NULL,0,emaShortPeriod,0,1,PRICE_CLOSE,1)。

如果(emaShort_1emaLong ) 返回(1); //上升趋势

如果(emaShort_1>emaLong_1 && emaShort<emaLong ) 返回(2); //下降趋势

返回(0); //没有行动

}

int start()

{

双倍BuyStopLoss, SellStopLoss, Lotsize ;

int cnt, ticket;

静态数据时间ordertime。

int total=OrdersTotal()。

如果(MoneyManagement=true)

{Lotsize=NormalizeDouble((AccountFreeMargin()*Risk/10000),1);}否则

否则

{Lotsize=Lots; }

BuyStopLoss=MathMin(MathMin(Low[1],Low[2]),Low[3]),Ask-StopLoss*Point);

SellStopLoss=MathMax(MathMax(MathMax(High[1],High[2]),High[3]), Bid+StopLoss*Point)。

如果(Time[0]>ordertime && total<Max_Contracts)

{

// 检查多头头寸(买入)的可能性

如果(Crossed()==1 )

{

OrderSend(Symbol(),OP_BUY,Lotsize,Ask,1,BuyStopLoss,Ask+TakeProfit*Point, "5-13-Long",Unique_Ref_Number,0,Green) 。

ordertime=Time[0];

return(0);

}

// 检查空头头寸(SELL)的可能性

如果(Crossed()==2 )

{

OrderSend(Symbol(),OP_SELL,Lotsize,Bid,1,SellStopLoss,Bid-TakeProfit*Point, "5-13-Short",Unique_Ref_Number,0,Red) 。

ordertime=Time[0];

return(0);

}

}

return(0);

}

 

编码员大师。

我需要你的帮助,做一个MT4的EA。

一天从格林尼治标准时间的0000开始。

1) 画5条水平线(不同颜色)。昨天的OHLC和昨天的(H+L)/2中位线。

2) 当价格触及5条线中的任何一条时发出声音并弹出警报。

如果你能提供帮助,那就太好了。谢谢...

 
MiniMe:
该指标用于绘制趋势线

我所希望的是能够改变趋势线的深度。

请帮助我

阿兰

这就是了。希望这是你想要的。

附加的文件:
 
Maji:
这就是了。希望这是你想要的。

非常感谢马吉,这正是我在寻找的。

原因: