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)
I am learning to code in EL and trying to generate a very simple strategy based on slope change but I would like to control the order entry using a flag as given in following code but orders are not getting generated, what am I doing wrong?
I want to control when to enter the market using LongTradeFlag and ShortTradeFlag but this simple thing I couldn't get it working. It compiles successfully but in real time on sim account orders are not generated.
I'd suggest to add print statements to your code, so you know what is going on internally. For example that your Condition1 and Condition2 can never become true and your system won't be able to enter trades.
Besides that as you start out, I'd suggest to get into the habit of using meaningful variable names and to comment your code as this will make your live so much easier down the road.
Thanks for your response, yes, I have to add print statements (I need to do some research on how to do it). I didn't get you point of Condition1 and Condition2 will never become true.
My thinking is when I turn on the strategy it should consider only SHORT TRADES as per the code isn't it? This is the main idea behind this exercise i.e control the entry in the strategy based on flag. If you have any better way to control the entries in a strategy please suggest.
Sorry, my bad I overlooked that you initialized ShortTradeFlag with true on declaration. I loaded your code here and it's taking plenty of trades, so it might just be a settings issue. I used an @ES# 5 minute chart and 10 days back.