entry pirce of subsequent entries

Questions about MultiCharts and user contributed studies.
janus
Posts: 838
Joined: 25 May 2009
Has thanked: 64 times
Been thanked: 105 times

entry pirce of subsequent entries

Postby janus » 02 Jun 2012

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.

User avatar
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

Postby JoshM » 03 Jun 2012

How do I get the entry price of the second one?

Code: Select all

PosTradeEntryPrice(0, 1);
To get the entry price of the latest entry of the current open position:

Code: Select all

PosTradeEntryPrice(0, PosTradeCount(0) - 1);
See PosTradeEntryPrice.

(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. ;) ).

janus
Posts: 838
Joined: 25 May 2009
Has thanked: 64 times
Been thanked: 105 times

Re: entry pirce of subsequent entries

Postby janus » 03 Jun 2012

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 :-)

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: entry pirce of subsequent entries

Postby Henry MultiСharts » 05 Jun 2012

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. ;) ).
Hello Josh,

Please explain in details what is incorrect with PosTradeEntryDateTime and the PosTradeExitDateTime keywords.

User avatar
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

Postby JoshM » 05 Jun 2012

Please explain in details what is incorrect with PosTradeEntryDateTime and the PosTradeExitDateTime keywords.
Hi Henry,

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.


Return to “MultiCharts”