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)
Hi Guys,
I'm totally a newb to this site and programming. I have been trying to solve this problem for a couple of days now , and i would greatly appreciate any sort of guidance on this subject. I'm missing a line of code that will trigger my "trailing stop" after my "target". Is there a way to always have "TrailingStop" triggered after "Target"?
Here's What i have as of now for long:
//Entry
If Condition1 then buy this bar at close;
//Exits
If marketposition=1 then
begin
Sell ("StopLoss") at xxx Stop;
If condition2 then sell ("Target") (CurrentShares/2) shares at close;
Sell ("TrailingStop")current shares at next bar at xxx stop;
End;
Thank you in advance for your help.
Can you help answer these questions from other members on NexusFi?
If it helps, all the buy and sell triggers are based on bar patterns and not set by $ amount target or stops. That's why sometimes "TrailingStop" is triggered before the "Target" is met.
you would need a flag that enables the trailing stop when your target conditions become true. Something like this might work with using a boolean variable called UseTrailingStop: