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)
Update profit target or trailing stop based on trade conditions
Does setprofittarget, SetPercentTrailing, and setstoploss get called on each bar or is it run once per strategy? I am struggling to get the below to be able to update values. Any ideas?
when you say "I am struggling to get the below to be able to update values", what happens exactly within your code? Did you use the print statement to check if the Condition1 and Condition2 variables are actually true on separate bars and if the values for your variables are updated?
Regards,
ABCTG
The following user says Thank You to ABCTG for this post:
You were right ABCTG. Looks like both conditions were false due to some other clearing logic I had going on. I have resolved the issue. Lesson learned, don't wrestle with one problem too long, sleep on it and clarity will come.
I am trying to create a trailing stop that moves my stoploss up to a specific positive value after the trade reaches the first target. I do not want it to be a percentage because as the first target is hit my next target is 2x first target and I want the difference to be the same value
from entry to original stoploss as the 1st profit threshold to 2nd stoploss.
I know I am asking a very simple question but for the life of me I can't figure it out.
I thought about moving the stoploss to a negative value since it is on the opposite side of a negative loss compared to the entry price. I don't think this will work but I will give it a try.
I have also had this idea come up before because I wanted to set a breakeven stop to breakeven plus a few ticks in the positive direction so I will more than likely not eat any slippage and commissions on a breakeven trade. I was unable to figure this out before but I imagine once I have the answer for one the other would be quite easy.