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)
imagine I place several stop orders on the market and one is filled.
How can I get from an easylanguage strategy the name (or reference) of the stop order filled?
The code to be executed later depends on that.
Can you help answer these questions from other members on NexusFi?
Also you can track how many positions or contracts are open ("CurrentContracts"). Then just do the math, if you went long 5 contracts and there are only 4 currently in the market, the contract with the nearest stop or target is out.
That way you show a tag next to each order on the graph window,
but how do you get it from within the code?
For example
Buy ("Entry1") Next Bar At function1 stop;
Buy ("Entry2") Next Bar At function2 stop;
Buy ("Entry3") Next Bar At function3 stop;
And next bar I want to know which of these stops was triggered
If it was Entry1 I'll execute some extra code Code1
If it was Entry2 I'll execute some extra code Code2
If it was Entry3 I'll execute some extra code Code3
The way I do it is like I said, I just track based on the number of CurrentContracts in the market, and I write my code in a way so that the 'nearest target' or 'nearest stop' code gets executed first when the CurrentContracts number drops.
The problem with this aproach is that many different orders could be triggered on the same (or similar) value and it could be impossible to tell them apart.
If you wrote it in C# and linked a DLL it might work, where you can just write a function to submit and sell an order, and have it tracked.
Doing it all in EL, the only other way I can think of is to use the entry time (if multiple entries per bar) or the entrybar to track which order is which.