EntryPrice showing 0 for buy to cover.  [SOLVED]

Questions about MultiCharts and user contributed studies.
maisatomai
Posts: 83
Joined: 18 Mar 2013
Has thanked: 11 times

EntryPrice showing 0 for buy to cover.

Postby maisatomai » 26 Oct 2014

For buy signal, the keyword entryprice allow me to know the price it bought at. But if for buy to cover signal, it shows 0. I tried exitprice but it still show 0. Anyone know how can I get the entryprice to buytocover?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: EntryPrice showing 0 for buy to cover.

Postby JoshM » 27 Oct 2014

For buy signal, the keyword entryprice allow me to know the price it bought at. But if for buy to cover signal, it shows 0. I tried exitprice but it still show 0. Anyone know how can I get the entryprice to buytocover?
EntryPrice returns the price at which the position opened: the `Buy` and `SellShort` prices.
ExitPrice returns the price at which the position was closed: the `Sell` and `BuyToCover` prices.

So `ExitPrice` will be the correct keyword here. But `EntryPrice` and `ExitPrice` do not immediately update:
EntryPrice will be available only at next calculation (next close by default) after entry order is filled and entry price is returned by your broker to MC.
Source.

So then the question is: how long do you see a 0 returned? In general, `ExitPrice(1)` will need to return the exit price of the previous position on the bar after this position was closed.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: EntryPrice showing 0 for buy to cover.

Postby Andrew MultiCharts » 27 Oct 2014

Hello maisatomai,

BuyToCover is an order to exit strategy, after it is triggered, the EntryPrice keyword will not returned any EntryPrice. Please try PosTradeExitPrice.

maisatomai
Posts: 83
Joined: 18 Mar 2013
Has thanked: 11 times

Re: EntryPrice showing 0 for buy to cover.  [SOLVED]

Postby maisatomai » 29 Oct 2014

actually I found the answer by chance. It exitprice(1).


Return to “MultiCharts”