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)
Possible to relocate a stoploss after position open?
Need a little help. I've been working on this for a couple of days now with no success.
I like using Risk/Reward multiples for money management...
For example, go long at 10 with a stop at 9 the Risk/Reward amount would be 1.
Should the price reach 11 I would like my new stop to be 10..
Should the price reach 12 I would like my new stop to be 11 and so on...
I have coded this up a number of ways in Multicharts, and the limiting factor seems to always be the sell "next bar" at ... The stop isn't always hit during the next bar, it can be any number of bars later.
The only way I can come up with to make this work is to change the setstoploss function as price progresses, but I have not been able to do this.
Any suggestions would be great
Thanks in advance.
Jeff
Can you help answer these questions from other members on NexusFi?
ABCGT.... if the stop is not hit the next bar, it will ignore the new stop placement, and revert to the original setstoploss and settarget functions.
NW27..... I have downloaded "NWT Exits" and had a good look through the code, actually for inspiration for what I'm trying to do, and from what I was able to tell it didn't do what I'm trying to do. But I will have another hard look at it tonight and see what there is to see.
you could prevent it from doing so by using a flag for example that blocks the code from resetting the stop to the original values when you have moved it.
I'm not familiar with flags, what would something like that look like?
Basically all I'm after is the ability to move my stop as the close of a bar reaches a new price level then have it stay there until it is hit or moved once again. It sounds simple enough don't you think?
Thanks for your suggestions.
I finally cracked it.
Instead of using "If C > " blah blah blah, I used "If Highest( C , Barssinceentry_checked( 0 ) ) >" blah blah blah.
That way it is continually checking back to the entry candle the highest close on every bar, and then the sell at next bar stop is not a problem.
I am glad to hear that you got it working. A flag can be something simple like a boolean variable that you set to true when your condition is met. Something like this, which is just a very basic example and is not meant to be used:
You could set the flag to false again when you are flat. This way the code can only set the initial stop once at the beginning of the position and after that only updates would be possible.