[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 345

 

Good afternoon!

This is a simple question, but something does not work, if you do not put StopLoss when opening an order, how do you write it correctly.

I tried to put NULL and 0.00000, but error 130 when trying to open an order.

Can you please tell me how to do it?

 
Boneshapper:

Good afternoon!

This is a simple question, but something does not work, if you do not put StopLoss when opening an order, how to write it correctly.

I tried to put NULL and 0.00000, but error 130 when trying to open an order.

Can you please advise how to do it?

0 should work

what are the other parameters? and how many digits are 4 or 5?

 
Boneshapper:

Good afternoon!

This is a simple question, but something does not work, if you do not put StopLoss when opening an order, how do you write it correctly.

I tried to put NULL and 0.00000, but error 130 when trying to open an order.

Can you please advise how to do this?


Write it this way: 0 is where it is set in the opening fie, besides in the ME editor to this fieu OrderSend () stand the cursor, press F1 and carefully read the contents of this help.

e.g.

OrderSend(Symbol(), OP_SELL, Lots, Bid, 0, 0, "старт", MagicNumber);
 

I wonder where the up variable gets the left value!

Please tell me if there is a mistake in the code or I don't understand

int up=0;
int init()
  {
//----
   up=0;
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+


int deinit()
  {
//----
   //Print(up);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   int i;
   int c=0;
   for (i=0;i<=3;i++)
   {
   if (iOpen("EURUSD",PERIOD_M5,i)>iOpen("EURUSD",PERIOD_M5,i+1))
   c++;
   
   }
   if (c==4)
   {
   up=up+1;
   }
   Print("c=",c,"up=",up);
   //----
   return(0);
  }
//+------------------------------------------------------------------+
 
solegs049:

I wonder where the up variable gets the left value!

Please tell me if there is a mistake in the code or I don't understand


UP can increment on every tick. It should be initialized in start().
 

I forgot to mention that I was testing on bar openings

the first value is already left and should be 0

and in start() if I initialize it (up) will be reset, but I need to count how many times there were (in this code 4) sequences

over a period of time

 
Help me to understand this question:

The ArrayMinimum() function, when applied to tick volumes, defines a bar with the minimal volume value and returns its index. The problem is this: I need to determine the index of the bar that also has minimal volume but higher than the one determined by this function (i.e. the second "minimal"). How can this be done?
 
-xlapex-:
Please help me with this question:

The ArrayMinimum() function, when applied to tick volumes, defines a bar with minimal volume value and returns its index. The problem is this: I need to determine the index of the bar that also has minimal volume but higher than the one determined by this function (i.e. the second "minimal"). How can this be done?


By looping through the cells of the array and comparing them with the already found minimum. The trouble is that there may be more than one identical value, so it's better to decide whether the required value is nearer the end, or the beginning of the array, and to break the loop as soon as it is found.
 
drknn:

Cycle through the cells of the array and compare with the minimum already found. The trouble is there may be more than one identical value, so it's better to decide whether the required value is near the end or the beginning of the array, and break the loop as soon as it's found.

We cycle through the volume values and find the minimum. How do we find the index of this bar?

The loop I used is as follows:

extern int Quant_Bars=5;
//-----------------------
int start()
{
int i;
double Minimum=10000;

for(i=0;i<=Quant_Bars-1;i++)
{
if (Volume[i]< Minimum)
Minimum=Volume[i];
}
Alert("Minimum ",Minimum);
return;
}

 

Can anyone tell me how to find, most easily, all (or not all, but some) of their posts on the forum in a particular thread?