Problem with EntryPrice

Questions about MultiCharts and user contributed studies.
itai007
Posts: 69
Joined: 14 Jun 2007

Problem with EntryPrice

Postby itai007 » 06 Mar 2008

If I understand correctly, using entryprice(0) should retrieve the most recent entry price of my position.

But if I buy several contracts , this reserved word , still retrieves the first entry out of the multi buying process ...

notice the attached screenshot showing this problem.....

where L-entry in the out put bar shows the entryprice value.


although there was another buy position , it still shows the first @ 6681.5.

If I ask the strategy to buy with -5 decrements from lastentry , then it will not work if it sees the first entry always as the last entryprice.

Please advise
Attachments
EntryPrice.PNG
EntryPrice.PNG (256.59 KiB) Viewed 730 times

itai007
Posts: 69
Joined: 14 Jun 2007

Re: Problem with EntryPrice

Postby itai007 » 09 Mar 2008

If I understand correctly, using entryprice(0) should retrieve the most recent entry price of my position.

But if I buy several contracts , this reserved word , still retrieves the first entry out of the multi buying process ...

notice the attached screenshot showing this problem.....

where L-entry in the out put bar shows the entryprice value.


although there was another buy position , it still shows the first @ 6681.5.

If I ask the strategy to buy with -5 decrements from lastentry , then it will not work if it sees the first entry always as the last entryprice.

Please advise
notice that there are already 2 long positions and in the print file "L-entry" shows the entryprice value of 6681.5 although the most recent buy executed @ 6678.5. So for some reason it will show the value of the first long position no matter how many long position I add..

How can I fix this ?
If I trade multiple entry and want an exit strategy of entryprice(0) + 0.5 for mini SP and don't mind that older long position that are still opened will not get filled .... ?

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 10 Mar 2008

This the way it works in TS and MC. I can't imagine a way to fix.

itai007
Posts: 69
Joined: 14 Jun 2007

Postby itai007 » 10 Mar 2008

This the way it works in TS and MC. I can't imagine a way to fix.
could you think of a way to retrieve the entry price using the label of the entry ?

deobisnath
Posts: 40
Joined: 17 Jul 2007

Postby deobisnath » 10 Mar 2008

I am afraid this is how it is in both MC and TS.

If your entry orders are buy/sell next bar at market then you the entry price is simply the open of the next bar; if not, then you can calculate the entry price with a bit of reverse engineering:

MyCurrentContracts = CurrentContracts ;
MyAvgEntryPrice = AvgEntryPrice ;


NewEntryPrice = ( ( CurrentContracts * AvgEntryPrice ) -
( MyCurrentContracts[1] * MyAvgEntryPrice[1] ) ) / ( CurrentContracts - MyCurrentContracts[1] );



I have written a pyramid system where I must calculate the entry price of each entry. I put all entry data in arrays so I can keep track of the list of
entries e.g. entry number - 1, 2, 3, 4; entry bar number, from bar 1 at 930 to bar 390 at 4pm; entry price; number of lots in each entry.

If you are trading multiple entries or pyramiding then you have to keep track of your entries. Hopefully, more support for pyramiding will be included in the next version


Regards,

Deosaran

itai007
Posts: 69
Joined: 14 Jun 2007

Postby itai007 » 10 Mar 2008

I am afraid this is how it is in both MC and TS.

If your entry orders are buy/sell next bar at market then you the entry price is simply the open of the next bar; if not, then you can calculate the entry price with a bit of reverse engineering:

MyCurrentContracts = CurrentContracts ;
MyAvgEntryPrice = AvgEntryPrice ;


NewEntryPrice = ( ( CurrentContracts * AvgEntryPrice ) -
( MyCurrentContracts[1] * MyAvgEntryPrice[1] ) ) / ( CurrentContracts - MyCurrentContracts[1] );




I have written a pyramid system where I must calculate the entry price of each entry. I put all entry data in arrays so I can keep track of the list of
entries e.g. entry number - 1, 2, 3, 4; entry bar number, from bar 1 at 930 to bar 390 at 4pm; entry price; number of lots in each entry.

If you are trading multiple entries or pyramiding then you have to keep track of your entries. Hopefully, more support for pyramiding will be included in the next version


Regards,

Deosaran
Pyramiding is what I do sometimes. How then would an array be constructed ?
could you share some know-how on this for the tracking need ?
Thanks

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 12 Mar 2008

This the way it works in TS and MC. I can't imagine a way to fix.
could you think of a way to retrieve the entry price using the label of the entry ?
I don't think it is an elegant solution. We just need to add a separate function in the future releases.

tradeprice
Posts: 10
Joined: 18 Nov 2010

Re: Problem with EntryPrice

Postby tradeprice » 15 Mar 2011

This the way it works in TS and MC. I can't imagine a way to fix.
could you think of a way to retrieve the entry price using the label of the entry ?


I don't think it is an elegant solution. We just need to add a separate function in the future releases.
And did you add a separate function already for the entry price problem?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 487 times

Re: Problem with EntryPrice

Postby Dave Masalov » 16 Mar 2011

tradeprice,

At the moment entryprice works the following way:

Returns a numerical value, indicating the price at the initial entry into the specified position.

EntryPrice(PosBack)

Where: PosBack - a numerical expression, specifying the position:

0 - open position;
1 - one position back (the last position closed);
2 - two positions back, etc.

If PosBack is not specified, a value for the open position will be returned.

If you use pyramiding, entryprice(0) will return average price for position.

janus
Posts: 764
Joined: 25 May 2009
Has thanked: 43 times
Been thanked: 86 times

Re:

Postby janus » 16 Mar 2011

This the way it works in TS and MC. I can't imagine a way to fix.
could you think of a way to retrieve the entry price using the label of the entry ?
I don't think it is an elegant solution. We just need to add a separate function in the future releases.
Please do - such a feature is very much needed. More importantly pyramiding features. It should have been there a long time ago but I do understand you are very busy.

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 487 times

Re: Problem with EntryPrice

Postby Dave Masalov » 17 Mar 2011

Dear Sirs,

Please post it as a feature request in Project Management.


Return to “MultiCharts”