weighted average price when averaging

Questions about MultiCharts and user contributed studies.
Shaman
Posts: 32
Joined: 03 Dec 2018
Has thanked: 5 times

weighted average price when averaging

Postby Shaman » 24 Dec 2018

Hi!
1. playing long I bought 10 contracts for the price of $ 100.
2. The price began to decline, but I decided not to leave the position, but to purchase another 20 contracts at a price of $ 90 (averaging).
3. The price has slightly increased to 92 dollars.
4. Now I want to put a stop at breakeven for my entire cumulative position (my loss = 0).

as I understand it, the EntryPrice function will give me the price of the first entry in a position = 100.

How can I get a weighted average price = (10 * 100 + 20 * 90) / (10 + 20) = 93.3333 ?

Or at least the price of the last transaction = 90? After all, then I could calculate the weighted average price myself.

Best regarts

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: weighted average price when averaging

Postby syswizard » 30 Dec 2018

AvgEntryPrice
Returns a numerical value, indicating the average entry price for all open entries in
a pyramided position.


Return to “MultiCharts”