Login Page - Create Account

Support Board


Date/Time: Fri, 22 Nov 2024 10:42:36 +0000



How to return the order quantity automatically to 1 after placing or order

View Count: 108

[2024-10-09 01:14:28]
User911751 - Posts: 1
Hello,
(1) I am placing an OCO order with a quantity of 3 (buy order ).

(2) I want the order quantity to go back to 1, once I have placed the above order in point number 1. This is so that next time I hit the sell market button, the quantity used is of 1 instead of 3 because I want to sell my positions one at a time and not make the mistake of selling all the 3 contracts in one shot. And I do not want to manually change the quantity to 1, because when I am in a
trade I do not remember to change the quantity back to 1. In other words, I want the default quantity to be one every time I have placed the order even if the order has been of Quantity 3.

Please let me know how to do this urgently. Thank you

Sincerely,
Anurag Chowdhry
[2024-10-09 03:21:46]
gcUserStudies - Posts: 106
I wrote a study that does this. It sets the initial quantity and then once the order is filled it changes it to whatever you want. Example. Initial order is 4, then once filled it changes to 1. I also put a scale out option. Example. If scale out is set to 50%. And initial order is 4. Then it changes to 2. Then 1 and 1.

I can post the code/study tomorrow if you want to try it out.
[2024-10-09 16:54:07]
gcUserStudies - Posts: 106
Here is the study file. Of course as always, test on SIM first and ensure it's doing what you expect.
Private File

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

Login

Login Page - Create Account