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
Sorry kwng your posting looks to me not the solution for madmax3
You don't have to modify trades in a funtion( ) called void CloseAll()
Also you have to select there OrderSymbol ( ) and OrderMagicNumber( )
and in this part of the program
pendingtrades will be still get modified
Here is the revised code for the whole EA:
The CloseAll() function is there to close the trades at a specified time if they go on for so long.
This part of the code is the revised part of what I'm trying to figure out:
(as you can see the MagicNumber and Symbol are there, however only the pending orders are still being modified)
You were told that the select will not work yesterday. And that you must test return codes and about total
If you're not going to bother to read the posts and correct your code, we are not going to bother to try and help you.
You were told that the select will not work yesterday. And that you must test return codes and about total
If you're not going to bother to read the posts and correct your code, we are not going to bother to try and help you.
I have done both of the above, you are referring to the wrong person methinks. I am the original poster not deVries and I have changed the code to this (as posted before):
The problem now is that it modifies pending orders while I want it to only modify open orders and only when two open orders from the same symbol are open and running at the same time. I have tried different number combinations and OrderSelect numbers but I'm still stumped on this.
I have done both of the above, you are referring to the wrong person methinks. I am the original poster not deVries and I have changed the code to this (as posted before):
The problem now is that it modifies pending orders while I want it to only modify open orders and only when two open orders from the same symbol are open and running at the same time. I have tried different number combinations and OrderSelect numbers but I'm still stumped on this.
So you need to loop through your open orders, check the Symbol and MagicNumber as you have above . . . but you also need to check for OrderType() <= OP_SELL . . . count the orders that match, if it is 2 . . . then loop again and OrderModify().
The only way you are going to learn is to read the Documentation about each function and get a grasp of how they work . . . e.g. OrderType()
I have tried a variation of different codes but still can't get it to work exactly. It modifies one of the open trades when two are open and it keep on modifying it, I only need it to be modified once and I need both trades modified.
Any suggestions as to what I should do? I have read up on the documentation btw.
First two orders are set, then one of them (a sell in this case when I tested the specific date) gets executed. Later on in the day the second order (which is still there) gets executed, and this trade is a buy.
The sell is order 1 and the buy is order 2. The buy (order 2) has it's TakeProfit modified by 16.3 pips (I'm not sure why it's not adding 20 pips), then the TakeProfit is increased by 0.2 pips in the same minute, and this keeps on happening, the TakeProfit is continuously modified throughout the day, sometimes increased, sometimes decreased, not sure why this is happening.
Edit: I think the 16.3 pips and further changes are also influenced by the spread?
You were told that the select will not work yesterday. And that you must test return codes and about total
If you're not going to bother to read the posts and correct your code, we are not going to bother to try and help you.
I have done both of the above, you are referring to the wrong person methinks
I was referring to your directly previous post
Here is the revised code for the whole EA: