[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 308

 
If I throw it out here
   if (var1 == var2) {
      if (var3 <= var4 - var5) return (TRUE);  return (FALSE);
   }
   if (var3 < var4 + var5) return (FALSE);
   return (TRUE);
}

this is

return (TRUE);
would the result be completely different?
 
asv:
If I throw it out here

this is

would the result be completely different?

The type of variables var1 and var2?
 

int var1, var2

double var3, var4, var5

 
asv:

int var1, var2

double var3, var4, var5


What should the signals be?

I've made the code a bit differently, I just need to add comments

In which cases it must be true and in which cases it must be false. And how are you going to distinguish these cases?

   if (var1 == var2) 
   {
      if (var3 <= var4 - var5) 
         return (TRUE);  
      else 
         return (FALSE);
   } 
   else 
   {
     if (var3 < var4 + var5) 
         return (FALSE);
     else 
        return (TRUE);
   }
 
This is just a piece of code. It's all inside the bool there
 
asv:
If I throw it out here

this is

would the result be completely different?
I'd tell you what you're doing, but you can't express yourself on the forum.
 

Help me with lines of code.
The main loop "for (i=2; i<100; i++)" calculates the variable Up_Price_Level. Then, as soon as Ask becomes higher than Up_Price_Level, the variable has to be reset to zero
. The variable should remain relevant on all subsequent bars until it is exceeded by Ask, or until the value of the variable itself changes in the loop "for (i=2; i<100; i++)" in the future. I.e. we need another cycle with comparison of Up_Price_Level and High[iHighest(NULL,0,MODE_HIGH,20,0)] - I don' t know how to bind sampling period to time of setting Up_Price_Level value.

 

Good evening all!

Please advise me, I have prescribed a function for opening an order. I can not deal with the colour parameter (to show the time of opening an arrow of a certain colour), I prescribed so OrderSend (Symbol(), OP_BUY, 0.01, Ask, 10, SL, TP, Lime), for this entry writes an error 4062. Then I just removed Lime and everything is working and orders began to open. I tried to prescribe Color L = Lime(respectively OrderSend (Symbol(), OP_BUY, 0.01, Ask, 10, SL, TP,L), but again I got a 4062 error. Then I prescribed string L = Lime(respectively OrderSend (Symbol(), OP_BUY, 0.01, Ask, 10, SL, TP,L).

 
Boneshapper:

Good evening all!

Please advise me, I have prescribed a function for opening an order. I can not deal with the colour parameter (to show the time of opening an arrow of a certain colour), I prescribed so OrderSend (Symbol(), OP_BUY, 0.01, Ask, 10, SL, TP, Lime), for this entry writes an error 4062. Then I just removed Lime and everything is working and orders began to open. I tried to prescribe Color L = Lime(respectively OrderSend (Symbol(), OP_BUY, 0.01, Ask, 10, SL, TP,L), but again I got a 4062 error. Then I put string L =Lime(respectively OrderSend (Symbol(), OP_BUY, 0.01, Ask, 10, SL, TP,L).


int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)

Parameters:
symbol - Name of the financial instrument, with which the trade operation is executed.
cmd - Trade operation. Can be any of the trade values.
volume - Amount of lots.
price - Opening price.
slippage - Maximum permitted price slippage for market orders (buy or sell orders).
stoploss - The price of closing a position when the loss is reached (0 if there is no loss).
takeprofit - The close price of a position when the profitability level is reached (0 if there is no profitability level).
comment - Order comment text. The last part of the comment can be changed by the trading server.
magic - Magic number of the order. Can be used as a user-defined identifier.
expiration - Expiration time of the pending order.
arrow_color - Colour of the opening arrow on the chart. If the parameter is missing or its value is CLR_NONE, the opening arrow is not shown on the chart.


What you do:

OrderSend (Symbol(), OP_BUY, 0.01, Ask, 10, SL, TP,L)

1. Specifying the symbol is correct,
2. Specifying a trade operation - true.
3. Specify the number of lots - correct,
4. Specify the opening price - correct,
5. Set the size of price slippage - correct,
6. Set the Stop price - correct,
7. Setting Take - right,
8. There should be a comment - and you write the colour of the arrow...
9. Magik - you don't have one,
10. Expiry date - you don't have it,
11. Arrow colour - should be the eleventh parameter.

 
Again, sorry: Maybe someone has already done this? Need function: there is a tick up - tickUP=1 (tickDN=0) and there is a tick down - tickDN=1 (tickUP=0)(maybe it will be one variable)