Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 396

 
Link_x:

That's the thing, I don't know which side to put it in. :)

Somewhere at the bottom, away from the start() function
 
Vinin:

Somewhere at the bottom, away from the start() function
Thank you.
And which variable in this function is responsible for showing the order type?
 
Link_x:


A little bit above.



I do not understand this particular function.
Which variable in it is responsible for outputting the order type?

Here you do not need to know which variable. The order type is determined by the value of the function. You usually need to know what variable the calculated value is in when the function type is void. In this case, the calculated value of the order type from the r variable is returned(r) operator;

operator is passed to the function value.

 
Link_x:
Thank you.
Which variable in this function is responsible for showing the order type?


The function returns the value of
 
khorosh:

Here you don't need to know which variable. The order type is determined by the function value. You usually need to know what variable the calculated value is in when the function type is void. And in this case, the calculated value of the order type is from the variable r using the return(r) operator;

is passed to the value of the function.



Vinin:

The function returns the value of


So I'm not destined to use this function. I'll make my own. :)
 
Link_x:




So I'm not destined to use this function. I'll make my own. :)
Why reinvent the wheel? And why not?
 
    if(OrderSelect(Symbol(),OrderType()) && OrderType() == OP_SELL)
    {
    Key = Buy_Key;
    }
    //|+---------------------------------------------------------------------------------------------------+
    if(OrderSelect(Symbol(),OrderType()) && OrderType() == OP_BUY)
    {
    Key = Sell_Key;
    }
Is this how it's going to work? :)

khorosh:
Why reinvent the wheel? And why not?


There is no variable in this function that can be compared to anything.

//|+--------------------------------------------------------+

invalid integer number as parameter 1 for 'OrderSelect' function

It won't work. :(


    if(OrderType() == OP_SELL)
    {
    Key = Buy_Key;
    }
    //|+---------------------------------------------------------------------------------------------------+
    if(OrderType() == OP_BUY)
    {
    Key = Sell_Key;
    }
This will work.
Now we need to come up with a "Starter".
 

Good evening to all. I am a beginner and would like to ask the following question. How to put a stop loss and take profit from the current price correctly? I tried to put a sell limit the current price was 1.3649 put Sell lemit 1.3700 stop 1.3600 teik 1.3750 and the order does not put!

 
oleg68:

Good evening to all. I am a beginner and would like to ask the following question. How to put a stop loss and take profit from the current price correctly? I tried to put a sell limit the current price was 1.3649 put Sell lemit 1.3700 stop 1.3600 teik 1.3750 and the order does not put!


Look at the minimum SL and TP, that your broker offers you.
I have for example 30 pips.
 
    if(OrderType() == OP_BUY)
    {
    Key = Sell_Key;
    }
    //|+---------------------------------------------------------------------------------------------------+
    if(OrderType() == OP_SELL)
    {
    Key = Buy_Key;
    }
And it doesn't go like that.
For some reason, "Key" without open trades takes on meaning:
Sell_Key
Buy_Key