[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 394
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
All right!!!! If there are no desired orders, X remains equal to zero with the desired magic number and the orders will be opened. If there are any, X equals 2 and no more orders will be opened.
So what else is the problem?
- At the very first moment, you select an order that does not exist using the OrderSelect function.
in the first loop for(int Uy=OrdersTotal();Uy<=-1;Uy--) So what, well the cycle runs more for hope, then I changed it to 0, there is no change in the work, these are all not errors, they do not change, I apologize.
Oh, what a nonsense. And at first, every time the date is not correct, about 49 times. Yes!!!! X always stays 0 and it writes fine. In 2 orders.
All right!!!! If there are no desired orders, X remains equal to zero with the desired magic number and the orders will be opened. If there are any, X equals 2 and no more orders will be opened.
So what else is the problem?
- At the very first moment, you select an order that does not exist using the OrderSelect function.
in the first loop for(int Uy=OrdersTotal();Uy<=-1;Uy--) So what, the loop runs more for hope, then I changed it to 0, there is no change in the work, these are all not errors, they do not change, I apologize.
How can it run longer than ?
No matter how many orders are open, the condition Uy<=-1 is not fulfilled immediately because the number of orders is greater than or equal to zero immediately
Help me find the error,
Thank you
If the ticks are running, the icon of EA is "smiling", EA should make deals (i.e. conditions for it appear), but it does not make them, then it is necessary to debug.
Arrange the price() command in the code of the EA, especially in those places where it is compared and see what exactly is being compared. Perhaps, you have a comparison on the equality of variables with type double and the comparison result is always false, while you assume that the variables are equal.
Thanks so much for the tips!!! Got my issue sorted out. It turned out that the broker I needed when placing a market order, i.e. according to the conditions, does not have the ability to place stop levels at the same time. Now the orders are placed without any stop levels and I set stop levels immediately after each order. I have a problem with this: Only a very small part of orders are modified, while most of the orders show the following results in the "Expert Advisors" section:
2011.05.19 09:46:55 Spacenewcomer-Svecha CLM1,M15: open #30906670 sell 0.01 CLM1 at 99.79 ok2011.05.19 09:46:55 Spacenewcomer-Svecha CLM1,M15: invalid ticket for OrderModify function
2011.05.19 09:55:40 Spacenewcomer-Svecha ESM1,M5: open #30906787 buy 0.01 ESM1 at 1337.50 ok
2011.05.19 10:00:03 Spacenewcomer-Svecha EURUSD,M15: invalid ticket for OrderModify function
Here is the code text:
{res=OrderSend(Symbol(),OP_SELL,0.01,Bid,3,0,0, "basic",_MagicNumber,0,Red);
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+StopLoss*Point,Ask-TakeProfit*Point,0,Red);
return(0);
}
And it's the first order that is modified after the start of the Expert Advisor!
Naturally, I've got the order modification wrong in the code... Please advise!
Can you suggest a code to determine the profit/loss on the last open order you have?
Measure in pips, the most reliable.