[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 535

 
DOCTORS:

Thank you very much!

For 2, can you tell me if you can use SetIndexStyle() to create a line of the desired length?

No. It has nothing to do with graphical objects.
 


Good day, good luck to all in robots and trading! Can you tell me if there's something wrong, my lot is growing incomprehensibly. It should not grow that fast. I have extern double volume=0.01; extern double volumee=volume; and finally, in the loop volumee++; I wrote it like this. Does volumee++; mean addition to itself and not addition to one? Please explain the syntax. It also warns 2012.01.27 15:16:49 2011.03.01 00:00 ant EURUSD,M15: invalid price 1.38088000 for OrderSend function, I set the price with the normal commands Ask and
Bid respectively.
Or what is it?



 

Please explain how I understand this part of the code.

int poz=OrdersTotal();

for (n=0;n<poz;n++){
if(OrderSelect(n,SELECT_BY_POS,MODE_TRADES)==true){

if (OrderType()==OP_BUY)

checks all open orders for open BUY orders ? Can it check from the first to the last order?

 
dkfl.zrjdktdbx:
Good day, good luck to all in robots and trading! Can you tell me if there's something wrong, my lot is growing incomprehensibly. It should not grow that fast. I have extern double volume=0.01; extern double volumee=volume; and finally, in the loop volumee++; I wrote it like this. Does volumee++; mean not addition to itself but addition to one? Please explain the syntax.
"++" means addition to a unit, not doubling.
 
Thank you! I'll know that now.
 
awega:

Please explain how I understand this part of the code.

int poz=OrdersTotal();

if (OrderSelect(n,SELECT_BY_POS,MODE_TRADES)==true){

if (OrderType()==OP_BUY)

checks all open orders for open BUY orders ? And it can check from the first to the last order?

No one forbids it, so we can check from the last order if we reverse the loop:

for (n = poz - 1; n >= 0; n--) {
   if (OrderSelect(n, SELECT_BY_POS, MODE_TRADES)) {
      if (OrderType() == OP_BUY) {
      // Какой-то код
      }
   }
}
 
Thank you
Reshetov:

No one forbids it, so you can do it from the latter if you turn the cycle the other way round:

 
Just keep in mind that "first and last" mean nothing in this case, as the order will be consistent with the column by which you have sorted the orders in the terminal before ;)
 

Hi all, can you tell me how many characters (digits) are allowed in magicnumber field?


int OrderSend(symbol,cmd,volume,price,slippage,stoploss,takeprofit,NULL,magic=(XXXXXXXXXXXXXXX)?,0,CLR_NONE);

 
fore-x:

Hi all, can you tell me how many characters (digits) the magicnumber field can hold?


int OrderSend(symbol,cmd,volume,price,slippage,stoploss,takeprofit,NULL,magic=(XXXXXXXXXXXXXXX)?,0,CLR_NONE);

the integer is int magic, the answer is, "int values must be in the range of -2,147,483,648 to 2,147,483,647. If the value of a constant or a variable is outside the specified range, the result of the program is undefined. The values of constants and variables of int type occupy 4 bytes in computer memory."

Hence, magic can consist of maximum 10 " signs (digits)".