OrderModify() question - page 4

 
WhooDoo22:

Simon,

Nope, not that I know of. There seems to be only two options and this option seems best for volume II. Also, it seems less complicated, and I don't mind that one bit. ;)

So, back to this task, I understand you used the order pool method for selecting the order on usdjpy pair, but what condition did you use to isolate the order on usdjpy?

Thank you.

Read back the question you just asked,  then look through the available Trading Functions,  the answer should jump out at you . . .  don't over complicate this exercise,  it took me 30 mins to code including fixing a few errors and testing.  My code is a script of 50 lines including plenty of comments, blank lines and braces.
 

The list of trading functions include: OrderSend(), OrderClose(), OrderCloseBy(), OrderDelete() and OrderModify().

It couldn't have been OrderSend(), OrderCloseBy(), or OrderDelete() function.

Two remain, OrderClose() or OrderModify() function.

Was it the OrderClose() function?


Thank you.

 
WhooDoo22:

The list of trading functions include: OrderSend(), OrderClose(), OrderCloseBy(), OrderDelete() and OrderModify().

There are 25 Trading Functions   <------  click the link
 

Oops, ADHD kicked in there for a second when reading that. ;)

Oh yeah, I am aware of the trading functions through use of the dictionary in MetaEditor.

I clicked the link, let me see...

Thank you.

 

It could have been OrderComment(), OrderLots(), OrderOpenPrice(), OrderOpenTime(), or OrderSymbol() functions. There are many functions you could have used as a condition to close usdjpy order.

I would think it might have been OrderSymbol() function because you are isolating a ticket based on a currency pair. Am I right?

Thank you.

 
WhooDoo22:

It could have been OrderComment(), OrderLots(), OrderOpenPrice(), OrderOpenTime(), or OrderSymbol() functions. There are many functions you could have used as a condition to close usdjpy order.

I would think it might have been OrderSymbol() function because you are isolating a ticket based on a currency pair. Am I right?

Thank you.

If I give you too many clues I might as well simply post my code . . .   I will if you want ?    

Look at the functions you have listed,  how could it be OrderComment() ?  how can you add a comment to a trade placed manually ? OrderLots(),  OrderOpenPrice(), OrderOpenTime()  tell you  the size of the trade,  we already know it is 0.1 lots,  open price,  OK,  maybe at a stretch this could be used but it is not 100% conclusive,  and the time the order was placed, how does this help you you ? 
 

Ha-ha, yeah, well, I like to get as many clues as possible to make this as easy as possible.

I can write a comment to a manual order in my mt4 terminal Simon. Haven't ya tried it? Give it a shot in a demo account if you get a chance. (but yeah, it seems this was not the condition)

Instructions: Right click an opened visual chart of EURUSD in terminal, click "Trading", click "New Order", then low and behold there is a Comment: box to type what you wish to use as a comment. ;)

Both OrderOpenPrice() and OrderOpenTime() can be recorded and used to isolate an order. (neither seem to be the lucky choice)

The OrderLots() function is more dificult to isolate a ticket BECAUSE you might have placed two tickets of 0.1 lots on two unique currency pairs. If this is the case, lot size does not help identify ticket. (Obviously this isn't and shouldn't be the condition used)

There is more than one way to accomplish a task. :)

Thank you.

 
WhooDoo22:

Ha-ha, yeah, well, I like to get as many clues as possible to make this as easy as possible.

I can write a comment to a manual order in my mt4 terminal Simon. Haven't ya tried it? Give it a shot in a demo account if you get a chance. (but yeah, it seems this was not the condition)

Instructions: Right click an opened visual chart of EURUSD in terminal, click "Trading", click "New Order", then low and behold there is a Comment: box to type what you wish to use as a comment. ;)

Both OrderOpenPrice() and OrderOpenTime() can be recorded and used to isolate an order. (neither seem to be the lucky choice)

The OrderLots() function is more dificult to isolate a ticket BECAUSE you might have placed two tickets of 0.1 lots on two unique currency pairs. If this is the case, lot size does not help identify ticket. (Obviously this isn't and shouldn't be the condition used)

There is more than one way to accomplish a task. :)

Oh yeah,  you are right,   I can place a comment on a manually placed Order . . . never noticed that before  :-)  but comments are not reliable, they can be changed or replaced by your Broker so it's not a good idea to rely on them.

 

You cant record the OrderOpenPrice() or OrderOpenTime() from when the orders were placed as they were done manually and you don't know when or at what price . . . " . . . forget the order in which you placed these Orders"   . . . .   your code can find this information but you would need to know you have the information for the correct Order(s),  back to square one.

 

There are at least 3 Orders of 0.1 lots,  GBPUSD, EURUSD and USDJPY    "place one market order for 0.1 lots with no TP or SL on GBPUSD,  one on USDJPY and one on EURUSD . . . forget the order in which you placed these Orders"


I only see one logic way to accomplish this task.

 

Simon,

I'm looking at the trading functions and reading, "place one market order for 0.1 lots with no TP or SL on GBPUSD,  one on USDJPY and one on EURUSD . . . forget the order in which you placed these Orders" and "I only see on logic way to accomplish this task."

It is a bit of a challenge for me because I have not used all of these functions in my coding history. I'll post what I believe might be an option below.

Thank you.

 
WhooDoo22:

Simon,

I'm looking at the trading functions and reading, "place one market order for 0.1 lots with no TP or SL on GBPUSD,  one on USDJPY and one on EURUSD . . . forget the order in which you placed these Orders" and "I only see on logic way to accomplish this task."

Bear in mind that you place the orders manually not using the code that you are writing . . .  feel free to place more orders on other pairs,  or the same pairs . . .  but you must have placed at least the 3 trades I specified before you run your code.


Don't forget the copy of the print out either from the log or the Experts tab that shows the ticket number of the USDJPY order(s)
Reason: