Average Price [BOTH SIDE]
-
hi, I'm testing various formulas to get an exact opening price for all long and short positions, I tried the example shared here on the average price forum and I could see that it only works well in one direction. I want to create a one condition formula, example: lots size buy! = Lots size sell
buy lots 0.02! sell lots 0.01 = data1
open price buy! open price sell = data2
data2 x data1 / data1 = result (open price both side)
I still haven't been able to understand how the code calculates the values, if anyone can help me I'm grateful
-
@duepips Not too sure what but if you use bucket of trades one for each type and save in to separate variables then use a formula block to divide and put into a separate variable, put all into a comment block so you can check what's happening.