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'd like to code a very simple strategy: daily candles, if market opened with at least a -0.5 gap from previous close, buy and place a sell order at whatever price it closed yesterday.
Unfortunately, I have no idea on how to code it.
How can I place a Sell order at Value1 limit on the same bar? This is not allowed, since "you cannot place limit orders on the same bar".
Should I move the chart to minute instead of daily?
Or should I use setprofittarget? I'd like to use it, but it wants profit in $ value, while I only know the price I want to sell at, not which profit I'd make with it.
Many thanks!
Can you help answer these questions from other members on NexusFi?
you would have to issue your limit exit order using "next bar" within the order command, but you could accomplish what you have in mind by storing the exit price in a variable while you are flat and then use the variable within your exit order.
I don't understand: I already have the exit price in a variable (Value1). The problem is that I can only sell at that price at next bar, not on this bar.
Yes, go intraday, easy solution.
If you don't have intraday data, this strategy is so easy that you can program it in excel, for which you definitely have data. And Excel doesn't forbid you to enter on the same bar.
What you are trying to do is the same thing that this "the gap guy" Scott Andrews did. Check him out, if you didn't.
you are welcome. The idea is that you only update the variable when you are flat and issue the order unconditionally using the "next bar" command.
On top of that you could most likely get rid of intrabar order generation completely in this case and use the "Open next bar" syntax for your entry. This thread should get you going: https://community.tradestation.com/discussions/Topic_Archive.aspx?Topic_ID=43394