Login Page - Create Account

Support Board


Date/Time: Wed, 15 May 2024 04:11:32 +0000



[Programming Help] - How to flatten orders sent by one chart and not the other chart

View Count: 421

[2021-07-02 11:03:31]
sushant - Posts: 32
Using the function flattenposition() flattens the position.
In my case I have 2 charts example 3min and 5min and I only want to flatten the order send by the 3 min chart only and not by 5 min chart.
How to achieve this
[2021-07-03 13:42:42]
bradh - Posts: 857
In order to flatten specific orders, you will need the internal orderid of the parent order. You will somehow have to save it as a persistent variable when the order is filled. I say somehow, because I don't know how those orders are being entered.
[2021-07-04 09:57:58]
sushant - Posts: 32
I store the order id of the order after that how to flatten that position.
some positions are also sold off by the target limit orders so the qty that was bought may not be same as the current holding
Is their some function that can flatten all the remaining qty that are present from a particular chart
[2021-07-04 11:26:57]
bradh - Posts: 857
Is their some function that can flatten all the remaining qty that are present from a particular chart

I would try sc.BuyExit(NewOrder) or sc.SellExit(NewOrder) after setting the internal orderid of the NewOrder.

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

Login

Login Page - Create Account