The question is not quite clear, but OK. It's very simple to write, almost the same as yours:
I'm not very good at explaining things, what can you do? Well, it was a digression, and now in fact there is a code composed of 2 parts, each is the appointment of the variable so the question is whether it is possible how to combine these two functions without cutting out anything from them
if(my_total_order == 0) //| //|
{double Lt=Lot; //| //|double PR=PRAsk; //| --- первая функция //|
OpenBuyOrder(Lt,PR); //| //|
OpenBuyStopOrder(Lt,PR); //| //|
OpenBuyLimitOrder(Lt,PR);} //| //|//+--------------------------------+ //|---- надо обеденить в однуif(my_total_order == 5) //| //|
{double Lt=Lot*3; //| //|double PR=PRBid; //| --- вторая функция //|
OpenSellOrder(Lt,PR); //| //|
OpenSellStopOrder(Lt,PR); //| //|
OpenSellLimitOrder(Lt,PR);} //| //|
проблема 'Lt' - variable already defined (уже определенная переменная),
'PR' - variable already defined (уже определенная переменная),
'Lt''PR' - они как раз и нужны но как им присвоить разные значения ?
I'm not very good at explaining things, what can you do? Well, that was a digression, and now in fact there is a code composed of 2 parts, each is the appointment of the variable so the question is whether it is possible to combine these two functions without cutting out anything from them
They can be declared as global, for example, outside of the function. And they are only needed to pass values Lot and PRAsk? It is possible to pass them directly, like I wrote.
ToLik_SRGV: You can declare them as global, for example outside of functions. Are they needed only to pass values of Lot and PRAsk? You can pass them directly, like I wrote.
Yes, but the value of one lot will be 10 and + each of them will be at PRAsk and PRBid total functions to open, namely " int OpenBuyOrder(double Lt, double PR).............." and the rest, will be hell of a lot, so I'm looking how it would not describe in 3 volumes
Returns the closing price when the stop loss for the currently selected order is reached. The order must be pre-selected using the OrderSelect() function.
double OrderProfit( )
)
Returns the net profit value (without swaps or commissions) for the currently selected order. For open positions, this is the current unrealized profit. For closed orders, it is the fixed profit. The order must be pre-selected using the OrderSelect() function. ================================================================================ ... and you write it into the variables.
Returns the closing price of a position when the stop loss level of the currently selected order is reached. The order must be pre-selected using the OrderSelect() function.
double OrderProfit(
)
Returns the net profit value (without swaps or commissions) for the currently selected order. For open positions, this is the current unrealized profit. For closed orders, it is the fixed profit. The order must be pre-selected using the OrderSelect() function.
I'm sorry, but I didn't ask how I should find StopLoss and TakeProfit data; we know that!
Dear programming experts! Could you please add the function of checking the opening hours to the EA code? I.e. the EA should open positions only within a certain time interval, for example from 8 am to 8 pm (Moscow time).
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
The question is how to write this function correctly
it works like this
and I need both to work please explain
It's not a very clear question, but okay.
It's very easy to write it down, almost the same as yours:
The question is not quite clear, but OK.
It's very simple to write, almost the same as yours:
I'm not very good at explaining things, what can you do? Well, it was a digression, and now in fact there is a code composed of 2 parts, each is the appointment of the variable so the question is whether it is possible how to combine these two functions without cutting out anything from them
I'm not very good at explaining things, what can you do? Well, that was a digression, and now in fact there is a code composed of 2 parts, each is the appointment of the variable so the question is whether it is possible to combine these two functions without cutting out anything from them
And they are only needed to pass values Lot and PRAsk? It is possible to pass them directly, like I wrote.
You can declare them as global, for example outside of functions.
Are they needed only to pass values of Lot and PRAsk? You can pass them directly, like I wrote.
Yes, but the value of one lot will be 10 and + each of them will be at PRAsk and PRBid total functions to open, namely " int OpenBuyOrder(double Lt, double PR).............." and the rest, will be hell of a lot, so I'm looking how it would not describe in 3 volumes
THE SOLUTION HAS BEEN FOUND, THANK YOU ALL.
Another question, how can I from a market order, price StopLoss andTakeProfit be assigned to a time variable ?
in without visualisation, why doesn't it work? Graphic objects, corner objects don't you use?
Another question is how can I assign the StopLoss and TakeProfit price from a market order to a time variable ?
Look for the required order in the market and use functions OrderStopLoss() and OrderProfit() to get the information you need...
================================================================================
The order must be pre-selected using the OrderSelect() function.
The order must be pre-selected using the OrderSelect() function.
================================================================================
... and you write it into the variables.
Search the market for the required order and use OrderStopLoss() and OrderProfit() to retrieve the information you need...
================================================================================
The order must be pre-selected using the OrderSelect() function.
The order must be pre-selected using the OrderSelect() function.
I'm sorry, but I didn't ask how I should find StopLoss and TakeProfit data; we know that!
Dear programming experts! Could you please add the function of checking the opening hours to the EA code? I.e. the EA should open positions only within a certain time interval, for example from 8 am to 8 pm (Moscow time).