Reply

Help with function OrdersAveragePrice

1 replies

webo

Subscriber, bbp_participant, community, 5 replies.

Visit profile

9 years ago #112976

Hello,

I’m trying to close a group of orders together and was thinking about using the function OrdersAveragePrice. However, it seems the parameter for that function is only a single order id (for example 1000) and I cannot set a group of orders I want to get the average open price from. I mean, if I want to use that function to get the average open price for a group of orders, how should I proceed? I guess I cannot open multiple orders with the same order id (example 1000). How can we use the function OrdersAveragePrice?, Can you please post an example?

Thanks in advance.

Best regards.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

9 years ago #127889

Hello,

 

I’m not sure what you want to achieve, but you can do it manually. Use OrderOpeningPrice() and mathematic funcitons to compute average open price if you need it.

 

For example

 

average price = (OrderOpeningPrice(1000) + OrderOpeningPrice(2000) + OrderOpeningPrice(3000)) / 3

 

You can create an equation like this using simple  Addition and Division functions, and assign a resulting value to a variable. I’m attaching an example, without actual orders opening.

Mark
StrategyQuant architect

0

Viewing 1 replies (of 1 total)