帮助寻找不平衡的左括号 - 页 5

 

使用打印报表来查看允许订单被发送的检查 值。

if(flag==1)  {
      Print("MAFast1=",MAFast1,"  MAFast2=",MAFast2","   MA....", MAFast3 /*and so on  */); 
      Ticket_L = OrderSend(Symbol(),OP_BUY,Lots,Ask,Slip,0,0,Comments,MAGIC,0,Red);
    }
 

我没有冒犯中国人的意思,我只是不懂中文,它往往会让我感到困惑......;)

关于你提出的如何做多头的问题,让我看看能否解释一下。

if(flag==1)  {  
      Ticket_L = OrderSend(Symbol(),OP_BUY,Lots,Ask,Slip,0,0,Comments,MAGIC,0,Red);
    }

如果比较的结果是将flag设为1,那么上述大括号{}之间的代码将执行。

否则,如果flag不包含1,程序将跳过大括号和它们之间的所有内容,并在结束的大括号后继续执行代码。

明白我的意思了吗?

零/。

 
Thank you i will add it and see . I really appreciate your helps.
 

我对你最好的祝愿,Ericman。

零/。

 
smoknfx:

我没有冒犯中国人的意思,我只是不懂中文,它往往会让我感到困惑......;)

关于你提出的如何做多头的问题,让我看看能否解释一下。

如果比较的结果是将flag设为1,那么上述大括号{}之间的代码将执行。

否则,如果flag不包含1,程序将跳过大括号和它们之间的所有内容,并在结束的大括号后继续执行代码。

明白我的意思了吗?

零/。

谢谢你的解释。每当你解决我的疑惑和问题时,我觉得我的大脑正在产生多巴胺。 我试着继续编码。谢谢。
 

ericman,

这是我的乐趣所在。

我的交易代码已经完成。

我只是在打发时间,同时运行我自己的真实交易。

我将会变得非常富有......比如,几十亿,你知道。

挖吧。

零/。

视频。Marilyn Manson - New @#$&%%

 
smoknfx:

ericman,

这是我的乐趣所在。

我的交易代码已经完成。

我只是在打发时间,同时运行我自己的真实交易。

我将会变得非常富有......比如,几十亿,你知道。

挖吧。

零/。

视频。Marilyn Manson - New @#$&%%


你为什么要显示马林-曼森的视频,我还以为你给我发了你的EA视频或其他东西呢,呵呵。谢谢你,无论如何,我都会继续编码的。

试图以一种简单的方式思考,除了不会持续下去,我猜...

 

既然这个主题已经成为了教授编程技术,我想我要把代码改一改,以帮助理解为什么代码可能没有达到预期的效果或调试的过程。

#define MAGIC  4649        

// parameter
extern double Lots = 1.0;     //
extern int Slip = 10;         //
extern string Comments =  ""; //

extern int FastMA1_p = 34;
extern int SlowMA1_p = 34;
extern int modeMA1 = MODE_SMA;
extern int modeMA2 = MODE_EMA;
extern int MA1Cross_Timeframe = PERIOD_M15;
extern int FastMA2_p = 68;
extern int SlowMA2_p = 68;
extern int CCI_p = 20;
extern int CCI_Buy_Point = 100;
extern int CCI_Sell_Point = -100;
extern int CCI_Timeframe = PERIOD_M30;
extern int Band_p = 6;
extern int Band_Timeframe = PERIOD_M15;



//variables//
int Ticket_L = 0; 
int Ticket_S = 0; 
int Exit_L = 0;   
int Exit_S = 0;   




int start()
  {


double MAFast1 = iMA(NULL, MA1Cross_Timeframe, FastMA1_p, 0, modeMA2, PRICE_CLOSE, 0);
double MAFast2 = iMA(NULL, MA1Cross_Timeframe, FastMA1_p, 0, modeMA2, PRICE_CLOSE, 1);
double MASlow1 = iMA(NULL, MA1Cross_Timeframe, SlowMA1_p, 0, modeMA1, PRICE_CLOSE, 0);
double MASlow2 = iMA(NULL, MA1Cross_Timeframe, SlowMA1_p, 0, modeMA1, PRICE_CLOSE, 1);
    
double MAFast3 = iMA(NULL, MA1Cross_Timeframe, FastMA2_p, 0, modeMA2, PRICE_CLOSE, 0);
double MAFast4 = iMA(NULL, MA1Cross_Timeframe, FastMA2_p, 0, modeMA2, PRICE_CLOSE, 1);
double MASlow3 = iMA(NULL, MA1Cross_Timeframe, SlowMA2_p, 0, modeMA1, PRICE_CLOSE, 0);
double MASlow4 = iMA(NULL, MA1Cross_Timeframe, SlowMA2_p, 0, modeMA1, PRICE_CLOSE, 1);
    
     
double cci1 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 0);
double cci2 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 1);
double cci3 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 2);
   
double bands_upper1 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_UPPER, 1);
double bands_upper2 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_UPPER, 2);
double bands_lower1 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_LOWER, 1);
double bands_lower2 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_LOWER, 2);

int flag=0;

     

   //Long position entry 
   
flag = 0 ; //ensures that code in development that might appear before this code has not corrupted what we need the status of flag to be

if(MAFast1>MASlow1 && MAFast3>MASlow3 && cci3<100 && cci2>=100 && cci1>100) flag=flag+1; //flag += 1; would do the same thing

if(MAFast1>MASlow1 && MAFast4<MASlow4 && MAFast3>MASlow3 && cci1>100) flag=flag+10; 

if(MAFast2<MASlow2 && MAFast1>MASlow1 && MAFast3>MASlow3 && cci1>100) flag=flag+100;

if(flag>0)  {
      Print("Flag=",Flag) ; //Now we can see which conditions were satisfied  
      Ticket_L = OrderSend(Symbol(),OP_BUY,Lots,Ask,Slip,0,0,Comments,MAGIC,0,Red);
    }
    

    
     
   return(0);
  }
 
ericman:


你为什么要显示马林-曼森的视频,我还以为你把你的EA视频或什么东西发给我了呢,呵呵。谢谢你,无论如何,我都会继续编码的。

试着用一种简单的方式来思考,此外,我想这是不可能的。


我在工作时享受我的音乐。

祝你在编码方面好运。

Iickyy现在有了方向盘。

我对你最好的祝愿。

零/。

 
我不接受指定的责任。