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)
Setting StopLoss in Easy Language via Variable1-99 (calculated live)
you can use the Marketposition reserved word to check that the first entry is only taken when flat or short and the second one only when you are long already.
From what you describe this should fix the issue.
Regards,
ABCTG
Can you help answer these questions from other members on NexusFi?
That's true. But the idea is to enter the market only in long direction. E.g. the baseline is that we are flat at the beginning so Marketposition = 0;
The condition to enter market is met so we:
Buy("LEx1") MyContracts contracts Next Bar at maxSetup stop;
Now we have Marketposition = 1.
Market is moving on and again condition is met so we:
Buy("LEx2") MyContracts contracts Next Bar at maxSetup stop;
and Marketposition = 1.
After some time SL is met for first position so we:
Sell("LXx") from entry("LEx1") Next Bar at slLong stop;
and still Marketposition = 1.
Next after some time condition for entering position is met but the system is not able to evaluate if we should use
Buy("LEx1") MyContracts contracts Next Bar at maxSetup stop;
or
Buy("LEx2") MyContracts contracts Next Bar at maxSetup stop;
But my knowledge is no so huge in EL so maybe there is some workaround . Every position will have other SL.
I see. You could use a combination of the market position and the last entry name to check and decide which order to use. However to receive the entry name in a multi leg position you will have to use StrategyHost object. You can find an example in the Tradestation forum here.