NexusFi: Find Your Edge


Home Menu

 





Coding an Exit method


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one Alessandro47 with 5 posts (0 thanks)
    2. looks_two occasionallurker with 3 posts (1 thanks)
    3. looks_3 Big Mike with 1 posts (1 thanks)
    4. looks_4 jlwtrading with 1 posts (0 thanks)
    1. trending_up 6,152 views
    2. thumb_up 2 thanks given
    3. group 4 followers
    1. forum 11 posts
    2. attach_file 0 attachments




 
Search this Thread

Coding an Exit method

  #1 (permalink)
Alessandro47
Sydney
 
Posts: 6 since Mar 2014
Thanks Given: 2
Thanks Received: 0

Dear All,

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.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Futures True Range Report
The Elite Circle
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
colion
Asheville, North Carolina
 
Posts: 24 since Sep 2010
Thanks Given: 1
Thanks Received: 15

Have you looked at the ApplyStop() function or the codes in the library?

Reply With Quote
  #3 (permalink)
 occasionallurker 
London UK
 
Posts: 18 since Mar 2014


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.

Reply With Quote
  #4 (permalink)
Alessandro47
Sydney
 
Posts: 6 since Mar 2014
Thanks Given: 2
Thanks Received: 0

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

Reply With Quote
  #5 (permalink)
 occasionallurker 
London UK
 
Posts: 18 since Mar 2014


Alessandro47 View Post
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?

Reply With Quote
  #6 (permalink)
Alessandro47
Sydney
 
Posts: 6 since Mar 2014
Thanks Given: 2
Thanks Received: 0

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.

Reply With Quote
  #7 (permalink)
 occasionallurker 
London UK
 
Posts: 18 since Mar 2014

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.

Reply With Quote
  #8 (permalink)
Alessandro47
Sydney
 
Posts: 6 since Mar 2014
Thanks Given: 2
Thanks Received: 0

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.

Reply With Quote
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,536

Moderator Notice
Moderator Notice



Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
Alessandro47
Sydney
 
Posts: 6 since Mar 2014
Thanks Given: 2
Thanks Received: 0


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.

Reply With Quote




Last Updated on May 2, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts