There is only one possibility that I can guess.
double Old_TP = OrderTakeProfit(); double Old_SL = OrderStopLoss();
In either of these 2 functions, are you selecting another order?
There is only one possibility that I can guess.
In either of these 2 functions, are you selecting another order?
No these are predefined functions but the below 2 are user_defined function and there is aloop going on in each one of them with orderSelect function
double New_TP = TPLevel_BUY(); double New_SL = SLLevel_BUY();
would that affect the code?
............the below 2 are user_defined function and there is aloop going on in each one of them with orderSelect function
would that affect the code?
Of course it will.
Of course it will.
So wont you tell me how ? :D as an example!
as this functions return a Price (value),?
So wont you tell me how ? :D as an example!
as this functions return a Price (value),?
You are selecting an order, then calling a function that selects a different order.
What do you think OrderTicket() will return?
You are selecting an order, then calling a function that selects a different order.
What do you think OrderTicket() will return?
but these called function does not return the selected order, it return double price value,
the selection in these function just to make some calculation but it does not return different ticket number !!!
would you explain more ?
but these called function does not return the selected order, it return double price value,
the selection in these function just to make some calculation but it does not return different ticket number !!!
would you explain more ?
OrderTicket() returns the ticket number of the last selected order.
OrderTicket() returns the ticket number of the last selected order.
but there shouldn't be any selected trade since the function should have been terminated by returning the double value which I print its output to make sure that it get the required value,
even if so in the called function there is a loop so all the trades are selected during the loop for checking and calculation, then why the pending order only is the one that kept selected even after the function exit and starting a new loop not any other trade ?but there shouldn't be any selected trade since the function should have been terminated by returning the double value which I print its output to make sure that it get the required value,
even if so in the called function there is a loop so all the trades are selected during the loop for checking and calculation, then why the pending order only is the one that kept selected even after the function exit and starting a new loop not any other trade ?One thing does not have to with the other. Selection of an order is a globally scoped operation. If you call a function that changes the order selection it is not restored upon return. If you want that, then you will have to implement it by saving the context and restoring it before returning.
One thing does not have to with the other. Selection of an order is a globally scoped operation. If you call a function that changes the order selection it is not restored upon return. If you want that, then you will have to implement it by saving the context and restoring it before returning.
can you provide me with a reference that I can read regarding this issue that would help me understand fully the issue and how can I overcome it in my future work?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have five orders on the chart, I am making a loop to select order to make some modification, it did not work so I print the order ticket along with its index to check, and I have noticed this
when these 2 line where here the it prints as follows
and that is the pending order only
while when I move these 2 lines to be as below
it print the rest , noting that the print function line has not been changed and the code compiled correctly both times
Please advise and thanks for your help