Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 20:26:50 +0000



[User Discussion] - Avg price or Flat to Flat instead of Lifo/Fifo

View Count: 585

[2020-09-02 14:42:00]
User734806 - Posts: 4
Hello,

Is there a way to use Flat to Flat or a price avg instead of Lifo/Fifo?
I tried "Trading: Position Average Price" but it seems to be using lifo

If not, then can I look at code for for "Trading: Position Average Price" to see if I can fork from there? as I'm new that would help a lot
or a good sample code that deal with past orders filled, quantity and price
I'm currently looking at Automated Trading From an Advanced Custom Study: Getting Order Information

I will investigate over the weekend, but questions in my min are:
1) Can I attached some strategy ID to the orders
2) can I filter all the order by strategy ID
3) Function like sc.GetFlatToFlatTradeListEntry(), I think they give past orders (entries + exits) from flat to flat.
3.a) Can I filter those by strategy ID or this function combine all strategies id?
3.b) For the current orders going on Stategy1 has 5 entries left, Strategy2 has 3 entries left (so more entries and exits happened). for Strategy1 can I get the list of all the order ending up to 5 entries fr this flat to flat? same thing for strategy2?

Basically what I'm trying to do is getting the list of all the orders that got filled for a particular strategy (strategy id) since it was last flat ? (I want this list to include the intermediate trades, meaning: +5ES, -2ES, +3ES,-1ES so the list include the 4 ES trades with a total quantity of +5 ES (+5 -2 +3 -1, 4 transactions)

Thank you for your help and advises
Date Time Of Last Edit: 2020-09-02 16:08:21

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account