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've been stuck on this problem for awhile and wondering if there is a simple solution.
I am using SetStopLoss to exit a position (say 20 ticks) but only want to re-enter a position if price has gone against the original entry price by at least 40 ticks at some point between my SetStopLoss exit and the next entry.
any suggestions?
Can you help answer these questions from other members on NexusFi?
we could try to point you in the right direction when you post the code you are stuck with.
One idea would be using a flag that you use to only allow another entry in case the market moved X points higher than your exit price.
you can access the exit price via the reserved word ExitPrice. This will work fine, unless you scale in and out of positions. In this case you can access the respective prices using the StrategyHost class.
The same way the entry price is accessible via the reserved word EntryPrice. @jrh059 you can use this to only allow a new entry when you are flat and if the current price is X ticks above the last entry price.
To clear up any confusion, once I am stopped out of a long position, I want price to go LOWER than where I was stopped out before taking another entry.
If ExitPrice(1)<=EntryPrice(1)-.20 and Lowest(Low,BarsSinceExit(1))<=EntryPrice(1)-.40 then
LongFalseStop=True;
If LongFalseStop=True then Buy
Using the print function, I can tell that this should work but the problem is that I can't figure out how to initiate the first entry without setting the LongFalseStop Variable to TRUE in the beginning, at which point the code doesnt work.
Thank you! That did work. However, now it seems that the LongFalseStop stays True for every bar following the first bar that it is True, making it ineffective because there is never a False condition. Is there a way to make it reset or reevaluate each bar?