calculate average cost
i want to calculate average cost
if i have data like
<span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">order_id </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">|</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> volume </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">|</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> price </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">|</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> type<br/> </span><span class="lit" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #7d2727;">1</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">|</span><span class="pln"