[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 450
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
Yes, but the point of the question is that the previous order was closed with a minus. The function does not have time to show this, first the order is opened after a couple of ticks and only then the function shows the last loss but the order has already been opened.
Why not use the Expiration pending order parameter.
There is of course a possibility that this parameter cannot be used.
On some trade servers, the expiration time of pending orders may be prohibited. In this case, an error 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated when trying to set a non-zero value in the expiration parameter.
That's the only way, of course...
I changed the line as you suggested and the Expert Advisor stopped working...
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,Ask+PriceDistance*Point,3,Ask+PriceDistance*Point-StopLoss*Point,Ask+PriceDistance*Point+TakeProfit*Point, "PD",1,TimeCurrent()+10*60,Green);
At the same time I know for sure there is no ban.
Please advise where the error may be.
I did so once again say does not have time to check first it passes as if there is no moose opens a deal and then it comes to him that there was a moose
I made changes to the line as you suggested, and the Expert Advisor stopped working...
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,Ask+PriceDistance*Point,3,Ask+PriceDistance*Point-StopLoss*Point,Ask+PriceDistance*Point+TakeProfit*Point, "PD",1,TimeCurrent()+10*60,Green);
At the same time I know for sure there is no ban.
Please advise where the error may be.
It is unlikely that it has stopped working, but your criteria are likely to be lame. Without the code, it's hard to think of a reason why the EA doesn't work...
This is all I've "scribbled" so far:
extern double TakeProfit = 50;// the end.
It works like this.... But, accordingly, opens trades indefinitely, the creeper.
Thanks in advance!
Here's all I've scribbled so far:
extern double TakeProfit = 50;// the end.
It works like this.... But, accordingly, opens trades indefinitely, the creeper.
Thanks in advance!
Learn how to insert code - read it all.
Learn how to insert code - read it all.
Roman, thank you for the answer!
What I have to do is to get my robot to open trades for a certain period of time from their automatic opening.
For example, the robot opens a TARGET trade, automatically sets expiry time +600 sec from the current one and that's it....
In this case, the option when he removes them himself does not fit, since TC on which I "train" there are restrictions on the modification of the pending orders if the price came closer than 10 points + Spread to the opening price, including those not yet open order.
Besides, the point is that if an order is already open, it should not be deleted, but it should be allowed to "play through" and fail. And if we set orderdelite, the function will also close the orders that have already triggered. (?)
As for the textbook - well, I'm not a programmer by temperament, I am a brilliant humanitarian - I draw, model, compose, and do not sharpen for anything else!)
I've been trying to get into it in good faith. Some of it made sense and some of it did not.
That's why I'm here.....
Roman, thank you for the reply!
It's just a matter of getting the robot to open trades on time from the moment they are automatically opened.
For example, the robot opens a TARGET trade, automatically sets expiry time +600 sec from the current one and that's it....
In this case, the option when he removes them himself does not fit, since TC on which I "train" there are restrictions on the modification of the pending orders if the price came closer than 10 points + Spread to the opening price, including those not yet open order.
Besides, the point is that if an order is already open, it should not be deleted, but it should be allowed to "play through" and fail. And if we set orderdelite, the function will also close the orders that have already triggered. (?)
As for the textbook - well, I'm not a programmer by temperament, I am a brilliant humanitarian - I draw, model, compose, and do not sharpen for anything else!)
I've been trying to get into it in good faith. Some of it made sense and some of it did not.
That's why I'm here.....
Try to describe in words what you've written here:
Personally for me at the very first glance it turned out to be a puzzle your idea: If one is not equal to one, then close the order...
I didn't watch the rest after that...
ZS and don't try, don't even think that it is possible to write a normal EA in one cycle...
...And if you put orderdelite, the function will also close orders that have already been triggered. (?)
...
No. Take a closer look. A triggered pending order becomes a market order - this function has nothing to do with it.
"Deletes a previously set pending order. Returns TRUE if function completed successfully. Return FALSE
if the function has not been completed successfully. Call GetLastError() to get error information."