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 reasonably new to AB but learning at a great rate of knots. I'd like to create some code as follows and would appreciate any advice:
After a Buy signal (already coded) set an initial stop at (say) 10% from the prior period close.
As prices rise, have the trailing stop follow up, trailing 10% from the highest close recorded since the Buy (a bit like a chandelier stop) i.e. the stop is never lowered.
Many thanks in anticipation of your assistance.
Cheers.
Can you help answer these questions from other members on NexusFi?
Here is a link to the knowledge base with an example that explains one applystop and one loop version AmiBroker Knowledge Base » How to plot a trailing stop in the Price chart both executing the same thing. You could alter that loop version to apply any other stop/target method or could write your own loop from scratch or just use Applystop function with built-in methods. If Applystop doesn't have your preferred method in place then as mentioned with a selfmade loop version you can create that one or any other one yourself.
Here is an example from the AB users forum trail stop+initial stop which seems to be similar to what you are looking for.
Thanks occasionallurker. Can you please advise how I can get a copiable version of the code you referred to in "Here is an example from the AB users forum trail stop+initial stop which seems to be similar to what you are looking for." as the link is an image file
Do you mean to say that both of your hands are too tired or too much broken or even too much non-existent in order to be able to transcribe just a few lines of code from a picture? What about the guy(s) who had to think and to write at the same time? Would you agree that doing just a little bit of handwork without thinking looks like a fair deal or would you agree that this world is becoming a sadder place with every new day?
You know what, that is exactly what I did in the end. Your impertinence and sarcasm is astounding to say the least. I agree the world is not what it used to be, particularly regarding manners and civility. Perhaps you had a bad day and if so I'm sorry for you, your wife or dog whichever you normally bully. Sometimes it's better to not respond and in this case it would have been better. In the meantime I sincerely wish you well in your trading.
That's interesting that posting two links and pointing out the truth about obvious laziness is equal to being impertinent nowadays. Please give me a moment to get the complete logic. I'm sorry in advance if it may take a few hundreds of years to understand even 1% of it since in my world the meaning of impertinence could rather be described by the words "Give them a finger, and they'll take the whole hand". But perhaps I haven't been realizing yet that I have been frozen for a few hundreds of years and the meaning has changed dramatically since back then. Then I'm very sorry for not being up-to-date. My bad. I'm gonna download and installl the most recent stupidity update from MS servers and reboot my brain.
In your response you demonstrate the same attitude "it's not me!". Go ahead and live in your ignorance but don't drag the world in to it. Quite frankly I find this, not you, boring. I will move on making good profits from good expectancy and leave you to it. As I said before I wish you well. Goodbye lurker.
A good outcome, thank you. I was just about to unsubscribe from the site because of this but am refreshed by the your decision. Life is too short so let's get on being positive. Good fortune to all who participate herein.