Download MetaTrader 5

Line Up By Time Lines

To add comments, please log in or register
cape1354
188
cape1354  

Hi guys


Please find some trouble in the code


Receive a double value through a function called " UpTrend ".


Each bar shows a number of digits such as 0, 9, or 1.1.0722.


The former is 0 and now tries to catch only the moment when tick is not zero.


ex) 0,0,0,0,0,1.0684

     Buy

Please find the problem in the code below.


    bool Firstorder = False;     
         for(int i =0; i<=2; i++)
            { 
                 double UpTrendS[1];
                 UpTrendS[i] = UpTrend;
                 Print(UpTrendS[i],UpTrendS[i+1],UpTrendS[i+2]);
                 if((UpTrendS[0]>UpTrendS[1]) && (UpTrendS[1] == 0) )
                  {  Firstorder = True;
                   Print("True");
                  }
                     
                   else
                   {Firstorder = false;
                   }
           

            return(0);
            }



And I know that " reference ", so please don't ask me to look for " reference ".

Please don't bother others to answer those questions.

whroeder1
16574
whroeder1  

cape1354:
Receive a double value through a function called " UpTrend ". Please find the problem in the code below.

double UpTrendS[1];
UpTrendS[i] = UpTrend;
Print(UpTrendS[i],UpTrendS[i+1],UpTrendS[i+2]);

The former is 0 and now tries to catch only the moment when tick is not zero.

  1. The array has a size of one, yet you try to print other values. You populate only one element and then try to print other values. That is not a function call.
  2. Why are you using an array? Just look for a change in condition
    double value = UpTrend();                             // This is a function call.
    static bool isUpTrend=false; bool wasUpTrend = isUpTrend; isUpTrend = value != 0;
    if(isUpTrend and !wasUpTrend) ...                     // moment when tick is not zero.


cape1354
188
cape1354  
whroeder1:
  1. The array has a size of one, yet you try to print other values. You populate only one element and then try to print other values. That is not a function call.
  2. Why are you using an array? Just look for a change in condition



Thank you for your response.


I will apply your opinion.

To add comments, please log in or register