Download MetaTrader 5

Original Pending Order Price - where is it?

To add comments, please log in or register
Follow the news. View our company's official channel!
jonus
221
jonus 2009.04.14 09:51 

Hey traders,

Is there a way to get the Orders original Pending Price?

Gordon Gekko
622
Gordon Gekko 2009.04.14 11:37  
hkjonus:

Hey traders,

Is there a way to get the Orders original Pending Price?

For example store it in the comment of the order.

Cheers

jonus
221
jonus 2009.04.14 11:40  
ggekko:

For example store it in the comment of the order.

Cheers


Is that field updatable? how? I only know you can use the OrderComment() function to retrieve the value. How to change it?

Gordon Gekko
622
Gordon Gekko 2009.04.14 11:45  
hkjonus:

Is that field updatable? how? I only know you can use the OrderComment() function to retrieve the value. How to change it?


You said original price. Original is original, not changes.

If you want to change that value, you have to use a variable for this.

jonus
221
jonus 2009.04.14 11:53  
ggekko:

You said original price. Original is original, not changes.

If you want to change that value, you have to use a variable for this.

dude,

when i enter a pending order at price=1.2000, It doesnt mean my OPENING PRICE will be 1.2000. I may get say 1.2003 or some other price and that number will be reflected as the OpenPrice.

but I need to know what the ORIGINAL Pending Order Price was. Are you clear on this?

now, please tell me how to set or make changes to the OrderComment field.

thank you!

JC
1456
JC 2009.04.14 13:26  
hkjonus:

dude,

when i enter a pending order at price=1.2000, It doesnt mean my OPENING PRICE will be 1.2000. I may get say 1.2003 or some other price and that number will be reflected as the OpenPrice.

but I need to know what the ORIGINAL Pending Order Price was. Are you clear on this?

now, please tell me how to set or make changes to the OrderComment field.

thank you!

AFAIK you can't change the order comment after the initial OrderSend(). However, I guess that ggekko's point is that you know the price you're requesting at the time you do the OrderSend(), therefore you can put it in the comment. Broadly speaking, something like the following:


double RequestedPrice = <whatever>

OrderSend(Symbol(), OP_BUYLIMIT, 0.01, RequestedPrice, 999, 0, 0, "Requested " + DoubleToStr(RequestedPrice, MarketInfo(Symbol(), MODE_DIGITS)));


But, if you change the requested price after the initial send, you can't then update the comment. AFAIK.


And there's a further problem: brokers can and do change order comments themselves under certain conditions. They're not really suitable as a "tag". As ggekko's also said, the only fully reliable way is to track such order metadata in variables, and to persist it outside the EA across restarts as necessary.

jonus
221
jonus 2009.04.14 15:01  
jjc:

AFAIK you can't change the order comment after the initial OrderSend(). However, I guess that ggekko's point is that you know the price you're requesting at the time you do the OrderSend(), therefore you can put it in the comment. Broadly speaking, something like the following:


double RequestedPrice = <whatever>

OrderSend(Symbol(), OP_BUYLIMIT, 0.01, RequestedPrice, 999, 0, 0, "Requested " + DoubleToStr(RequestedPrice, MarketInfo(Symbol(), MODE_DIGITS)));


But, if you change the requested price after the initial send, you can't then update the comment. AFAIK.


And there's a further problem: brokers can and do change order comments themselves under certain conditions. They're not really suitable as a "tag". As ggekko's also said, the only fully reliable way is to track such order metadata in variables, and to persist it outside the EA across restarts as necessary.


Yes I see. I guess an inherint weakness of this environment is the inability to tag the orders with some useful info (on the servers data side) and track them. Ive decided to use Labels on the chart to post the Original Price and also the current Level of the trade (for closing partials). Ive noticed these are persistent across restarts. Thats good enough for my purposes. I dont want to get involved in reading & writing local datafiles.


Thanks jjc

Gordon Gekko
622
Gordon Gekko 2009.04.14 15:57  
hkjonus:

dude,

...

dude,

You can use global variables as well. They are persistent across restarts.

jonus
221
jonus 2009.04.14 18:04  
ggekko:

dude,

You can use global variables as well. They are persistent across restarts.

Yes, looks like I will have to use Globals since there is a ObjectSetText but NO ObjectGetText !

What the hell would I do if I need to store some TEXT information somewhere? Global Variables are type Double only.

JC
1456
JC 2009.04.14 18:14  
hkjonus:

Yes, looks like I will have to use Globals since there is a ObjectSetText but NO ObjectGetText ! 

See ObjectDescription()

Tovan Adams
168
Tovan Adams 2009.04.14 21:40  
hkjonus wrote >>

Yes I see. I guess an inherint weakness of this environment is the inability to tag the orders with some useful info (on the servers data side) and track them.

Actually.... Dude,

You can use the Magic Number to track orders. Each order can have an individual Magic Number - if you wish. Then, in an array or whatever, you can tie whatever information you want to that Magic Number and hence that order. You just have to manage your assignment of Magic Numbers across all of your EA's that run on a particular account.

12
To add comments, please log in or register