[存档!]任何菜鸟问题,为了不给论坛添乱。专业人士,不要与它擦肩而过。没有你,哪里都不能去 - 2. - 页 270

 

大家好。

需要帮助 - 告诉我如何在EA中做到这一点。

将一个指标叠加在另一个指标上?

我调用第一个指标,它从图表中获取数值。

如何调用第二个,使其从第一个中获取数值?

如果可能的话,请举例说明(让我们把缪斯的做法 应用于atp)。

预先感谢你。

 

你们能不能告诉我代码 中哪里有错误?专家顾问只买了...在停止或采取后,它等待,直到酒吧关闭并再次买入......如果我在前几行交换买入和卖出,它只是卖出...请告诉我这可能是什么...

if (PerkyBuf1!=0 && OrdCon(MG)==0) {OrderOp(OP_SELL,Lots);  
    }  
    if (PerkyBuf2!=0 && OrdCon(MG)==0) {OrderOp(OP_BUY,Lots);  
    }
 }

return(0);
}


int OrderOp(int ord,double lot)  
{
   int ticket1;
   string ccm="";
   double l;
   bool SLTP;
   
   
   if (ord==OP_BUY) {
      l=NormalizeDouble(MarketInfo(Symbol(), MODE_ASK), MarketInfo(Symbol(), MODE_DIGITS));
      ccm="pivot: BUY";
      ticket1=OrderSend(Symbol(),ord,lot,l,3,0,0,ccm,MG,0,White);
      if (ticket1!=0) {
            if (StopLoss!=0) {SL=NormalizeDouble(l-StopLoss*Point,Digits);}
            if (TakeProfit!=0) {TP=NormalizeDouble(l+TakeProfit*Point,Digits);}
            SLTP=OrderModify(ticket1,OrderOpenPrice(),SL,TP,0,Red);
            if (SLTP) {return(0);}
      } 
   }           
   
   if (ord==OP_SELL) {
      l=NormalizeDouble(MarketInfo(Symbol(), MODE_BID), MarketInfo(Symbol(), MODE_DIGITS));
      ccm="pivot: SELL";
      ticket1=OrderSend(Symbol(),ord,lot,l,3,0,0,ccm,MG,0,White);
      if (ticket1!=0) {
            if (StopLoss!=0) {SL=NormalizeDouble(l+StopLoss*Point,Digits);}
            if (TakeProfit!=0) {TP=NormalizeDouble(l-TakeProfit*Point,Digits);}
            SLTP=OrderModify(ticket1,OrderOpenPrice(),SL,TP,0,Red);
            if (SLTP) {return(0);}
 
Mihoi:

大家好。

需要帮助 - 告诉我如何在EA中做到这一点。

将一个指标叠加在另一个指标上?

我调用第一个指标,它从图表中获取数值。

如何调用第二个,使其从第一个中获取数值?

如果可能的话,请举例说明(让我们把缪斯的做法应用于atp)。

预先感谢你。

在ATR指标本身 中多输入几行。

解决这个问题的一个好例子是自定义指标 组中的MACD指标。

打开MACD指标代码,看看它是如何完成的。

它非常简单。iMAOnArray()。

 
ostrik:

你们能不能告诉我代码中哪里有错误?专家顾问只买了...在停止或采取后,它等待,直到酒吧关闭,然后再次买入......。如果我在前几行交换买入和卖出,它只是卖出...请告诉我这可能是什么...


if (PerkyBuf1!=0 && OrdCon(MG)==0) {OrderOp(OP_SELL,Lots);  
    }  
    if (PerkyBuf2!=0 && OrdCon(MG)==0) {OrderOp(OP_BUY,Lots);  
    }
 } --- может, эта скобка лишняя???
 
谢谢,我会试一试的。
 
DhP:



不,支架看起来很好...
 
ostrik:

不,托架很好...

你们有点暗示,你们提供了不完整的代码与不完整的功能。

事实上,打印或评论 规则。

 
sergeev:

你们有点暗示,你们提供了不完整的代码与不完整的功能。

一般来说,打印或评论规则。


问题是,我刚刚学习了这些困难的东西,而我根本不能做任何事情......我有种感觉,我的手没有向正确的方向生长 ))

 

你好,如何将指标线 向前移动一格?

#property copyright "autoforex"
#property link "http://www.autoforex.ru"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_style1 0

double Buffer1[];

int init()
{
SetIndexBuffer(0,Buffer1);
SetIndexStyle(0,DRAW_LINE);
return(0);
}
int start()
{
for(int i=0;i<Bars;i++)
{
Buffer1[i]=High[i];
}
return(0);
}

我有一个想法,代替Buffer1[i]=High[i]; 把Buffer1[i-1]=High[i]; 但可惜的是,它不能向前绘制(
)

 
tmt0086:

你好,如何将指标线向前移动一格?

#property copyright "autoforex"
#property link "http://www.autoforex.ru"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_style1 0

double Buffer1[];

int init()
{
SetIndexBuffer(0,Buffer1);
SetIndexStyle(0,DRAW_LINE);
return(0);
}
int start()
{
for(int i=0;i<Bars;i++)
{
Buffer1[i]=High[i];
}
return(0);
}

我有一个想法,代替Buffer1[i]=High[i]; 把Buffer1[i-1]=High[i]; 但可惜的是,它并没有向前画(


想通了