Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
How to abstract a functionality so it can run multiple strategy orders using ACSIL?
Say I have the following code below (not sure if it is completely correct, but I am trying to get the idea though):
I want to be able to get the bid volume for that price in the current bar. Based off of that, I want to check if the bid volume is 200 or more. If it is, I want to send a strategy order directly coded in ACSIL (a parent order with attached orders--basically a bracket orders and stops.)
An order of such description could be open for many bars, however, my study could also open many many orders (up to 1000) that each span over many bars.
How would I go about keeping track of all those orders? How would I abstract things so that, if a certain condition happens, the study would go and update one or more of those orders depending on what I want (it could be canceling, changing price up or down, or quantity).
Has anyone perhaps done something resembling this that I can look at their code?
Can you help answer these questions from other members on NexusFi?
I coded a system that uses 3 orders and different stop management rules for each order. Here's some description from the code:
//after 8 ticks profit, the stop is raised to -3 ticks from our entry point
//at 17 profit, move up stop on one contract to entry point +10 ticks
//once we are +40, move the 50 target contract stop up to +25 ticks, leave the 80 tick target contract stop at breakeven
//after 68 ticks, the 80 tick target contract's stop is moved to +50
I am very rusty on ACSIL right now because I haven't used it for a few months, but I'm happy to share my code with you so you can learn from my methods.
I haven't tested this with live trading, but it works well in simulation. I've found it to be profitable during certain times for certain markets in certain conditions.
This system enters a trade once a breakout from a time-defined range occurs. There's no secret edge in this code, but the methods used in it could apply to many different trading systems.
Checking the volume as a condition for trade entry shouldn't be difficult.