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)
if value1 < Threshold and marketposition = 0 then buy next bar at high stop high limit ;
if value1 < Threshold and marketposition = 0 then sellshort next bar at low stop low limit;
setexitonclose;
setbreakeven(75);
Basic skeleton code for now, stuck on the stoplimiting!
Signal bar is determined by value1 then I want to buy/short the breakout of the next bar with a limit stop just above/below the signal bar's high/low. On the picture the lines indicate pretty much what the limit order are meant to catch. So should be stop limits right!?!?
Do you really need a stop-limit entry? Isn't a stop entry enough?
Anyway, what exactly does not work? In other words: what is the problem?
The orders are not executed?
You just want to add the feature "after 2 bars, cancel it"?
In order to help you, below please find an example of code.
The signal is: two HH in a row (= 2 bars with a H higher than the bar before)
In case of signal, entry long next bar with a stop order at the H of the current bar (your breakout)
The signal is valid for 3 bars (the entry level remains the H of the signal pattern, not the H of the last bar).
I do not say that this code is perfect. I've prepared it in 10 minutes. But it can give you food for thought.
I'm lost. You refer to 1.(a) and "stop limit order" whereas "stop limit order" was 1.(b).
Sorry about my questions: I just want to understand what you want, and it is still unclear.