[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 192

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Igor Kim has an advisor that does the following at a set interval
Thank you!
Hello.
Problem with pending orders, specifically the expiry date.
This is how a new order is opened, i.e. if it has not been triggered in one hour, the server should close it.
Then I check what is the expiry date:
This is what I get when the EA works in the tester:
2013.03.01 12:45:58 2012.01.11 11:00 #advisor# EURUSD,H1: open #1 sell limit 2.00 EURUSD at 1.27972 ok
2013.03.01 12:45:58 2012.01.11 11:00 #advisor# EURUSD,H1: Alert: OrderExpiration = 2012.01.11:12:00
2013.03.01 12:45:58 2012.01.12 16:29 Tester: order #1, sell 2.00 EURUSD is opened at 1.27972
That is, date and time of expiration are set correctly, as I want, but there is no close at the time of expiration - a position is opened after 24 hours.
I searched a few forums and the problem occurs. The usual answers are "it works for me" or "trace the pending orders yourself". I do not want to track them myself and it is not working for me.
Igor Kim has an advisor that does the following at a set interval
It works great.
Thanks for the tip!
It works great.
Thanks for the tip!
It's not me, it's Google.
I think you can pull the save screen function from there yourself and set your own parameters to call it - I was too lazy...
Sergey! I am leaving the question about the function open for now, as tomorrow I will insert some more functions into your test EA to conduct a clean experiment. I have watched it in visual mode and almost all double closes are the last, the earlier ones are closed by SL and TP, i.e. there is nothing to choose from. I have removed Stops and Takes in order to have something to choose from. Tomorrow I will show your Expert Advisor with all additional functions and comments! You will be able to see for yourself how the function works. I really want it to show that I was wrong! If I am right, I will try to do my best! See you tomorrow!
Sergey, Dubakin, good morning (to me) and good afternoon (to you)! Did a visual check and made sure that this function selects the maximums, which is what I needed! I'm glad I no longer have any doubts, and my apologies to you! But in our business "it's better to measure seven times..." Showing your tester EA for function checking, with added features and comments for a clearer visual check! Thank you!
Sergey, Dubakin, good morning (for me) and good afternoon (for you)! Did a visual check and made sure that this function selects maximums, which is what I needed! I'm glad I no longer have any doubts, and my apologies to you! But in our business "it's better to measure seven times..." Showing your tester EA for function checking, with added features and comments for a clearer visual check! Thank you!
How so... Based on Igor Kim made something... Only one of your features... the rest are the same...
something like this, I guess:
And call her out:
for counting Buy and counting Sell by the current symbol, with Magic
Can you tell me how to choose the smallest lot among all open trades?
double min=0;
int min_ticket=0;
for(i=0;i<ot;i++)
{
if(!OrderSelect(i,SELECT_BY_POS)) continue;
if(OrderType()!=OP_BUY && OrderType()!=OP_SELL) continue;
if(i==0||min>OrderLots()) {min = OrderLots(); min_ticket=OrderTicket();}
}
The i variable has a value of 0 only at the beginning of the loop. Further it will add 1 value with each iteration.I've been browsing the thread. Your logic is strange. I am interested in the last line of code:
Then there is a condition that will cause the loop to continue:
But min is declared as zero and its value doesn't change anywhere else in the code. Which means that this value will never be true! Where is the logic?
Variable i has a value of 0 only at the beginning of the loop. Further it will add value with each iteration by 1.I've been browsing the thread. Your logic is strange. I am interested in the last line of code:
Then there is a condition for the cycle to continue:
But min is declared as zero, and its value never changes anywhere else in the code. Which means that this value will never be true! Where is the logic?
Variable i has value 0 only at the beginning of the loop. Further it will add value with each iteration by 1.I looked through the branch. Your logic is strange. I am interested in the last code line:
Then there is a condition for the cycle to continue:
But min is declared as zero, and its value never changes anywhere else in the code. Which means that this value will never be true! Where is the logic?Please note
If min>OrderLots(), then min = OrderLots();
Please note
If min>OrderLots() then, min = OrderLots();