entry pirce of subsequent entries
entry pirce of subsequent entries
Hows does one get the entry price of other orders placed after the initial one? For example, I issue a buy order on one bar then on the next bar I issue another buy order (different label of course). Entryprice only ever returns the entry price of the first order. How do I get the entry price of the second one? I could use avgentryprice to work it out but that could be complicated if I also cover some longs in between. There has to be a better way.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: entry pirce of subsequent entries
How do I get the entry price of the second one?
Code: Select all
PosTradeEntryPrice(0, 1);
Code: Select all
PosTradeEntryPrice(0, PosTradeCount(0) - 1);
(Little note FYI regarding the PosTrade* keywords, there's a bug with the PosTradeEntryDateTime and the PosTradeExitDateTime keywords. So don't pull out your hairs when you come across it. ).
Re: entry pirce of subsequent entries
Thank you JoshM. I must be getting old. I now remember I did come across it many months ago but I forgot about it!
As a general note to the MC team, I like them to improve the help facility such that related keywords are cross-linked. For example in the case of EntryPrice, it should have a link to related words, in this case PosTradeEntryPrice, and vice versa. Many other help facilities do this and makes a world of difference. It also helps people like me who are getting old and forgetful
As a general note to the MC team, I like them to improve the help facility such that related keywords are cross-linked. For example in the case of EntryPrice, it should have a link to related words, in this case PosTradeEntryPrice, and vice versa. Many other help facilities do this and makes a world of difference. It also helps people like me who are getting old and forgetful
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: entry pirce of subsequent entries
Hello Josh,Little note FYI regarding the PosTrade* keywords, there's a bug with the PosTradeEntryDateTime and the PosTradeExitDateTime keywords. So don't pull out your hairs when you come across it. ).
Please explain in details what is incorrect with PosTradeEntryDateTime and the PosTradeExitDateTime keywords.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: entry pirce of subsequent entries
Hi Henry,Please explain in details what is incorrect with PosTradeEntryDateTime and the PosTradeExitDateTime keywords.
Thanks for your offer to help, but the behaviour I was referring to is already known to MC (in emails reported first April 17th, confirmed April 25th, and won't be fixed confirmed June 4th).
I just mentioned it here since, if Janus chooses to use the PosTrade keywords, it might save him a lot of time debugging and re-analysing his PosTradeEntryDateTime and PosTradeExitDateTime output.
Summarized:
Compared with the trade times ('Generated' and 'Filled\Cancelled' columns) in the Order and Position Tracker the PosTradeEntryDateTime() and PosTradeExitDateTime() always (meaning: consistently) give a time prior to the generated trade time.
This time difference is often around 4-5 seconds, but in some instances > 60 seconds.