Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now, It is 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
Available coupon codes for premium Elite Membership:
If you are a researcher and pay attention to details, you qualify for our 10% discount - "CHARTIST"
If you are a veteran or in public/community service, you qualify for 15% discount - "PURPLECHART"
If you are 60+ years old, you qualify for our 20% discount - "WISDOM"
Discounts are based on the honor system. If we can't trust you to do the right thing, please move along.
(If you already have an account, login at the top of the page)
So I've been going back and forth trying to get this to work. I would love to use the PercentTrailing code with my strategy but I don't want for the order to be submitted intrabar (too many fluctuations). I would like to assess the max run-up of the position and calculate how much that max run-up has come down @ the close of the bar (not intrabar).
I tried to code this multiple ways into my strategy, but everything I've tried works nothing close to adding a "PercentTrailing" to my strategy. My attempts are below. Any suggestions would be greatly appreciated!
1) make it a condition, and when said condition triggers it would exit the position
2) Then I tried putting this at the end of my code to exit as well:
Again, non of these "solutions" worked like the true SetPercentTrailing code. Any ideas of how to work this on the close of the bar?
Thanks!
Brandon
Can you help answer these questions from other members on NexusFi?
when the condition for your stop is met you can send an order to close the open position, for example
This would issue the order at the end of the bar and you'd get executed around the open of the next bar. Which is to be expected when you send an order at the close.
You could fool your software (and yourself as you will create results that you can't reproduce live) by using "this bar Close" for the order, but this will likely not be the fills you get live.
You could look into custom sessions that would allow you to walk around that problem or to use intrabar order generation, which would give you the ability to close out the position near the actual bar close.