EntryPrice showing 0 for buy to cover. [SOLVED]
-
- Posts: 83
- Joined: 18 Mar 2013
- Has thanked: 11 times
EntryPrice showing 0 for buy to cover.
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?
- 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.
EntryPrice returns the price at which the position opened: the `Buy` and `SellShort` prices.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?
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:
Source.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.
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.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: EntryPrice showing 0 for buy to cover.
Hello maisatomai,
BuyToCover is an order to exit strategy, after it is triggered, the EntryPrice keyword will not returned any EntryPrice. Please try PosTradeExitPrice.
BuyToCover is an order to exit strategy, after it is triggered, the EntryPrice keyword will not returned any EntryPrice. Please try PosTradeExitPrice.
-
- Posts: 83
- Joined: 18 Mar 2013
- Has thanked: 11 times
Re: EntryPrice showing 0 for buy to cover. [SOLVED]
actually I found the answer by chance. It exitprice(1).