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 trying to use the SuperTrendU11 indicator as a stop loss in my strategy.
However I need the uptrend and downtrend lines (respectively my short stop loss and long stop loss) to be generated only when my strategy enters position. e.i. my strategy is a MovingAverageCrossOver, I would need SuperTrendU11 to switch from uptrend to downtrend on the MovingAverageCrossOver. Is this possible?
Could somebody please indicate me what part of the code I must modify in order to make this possible.
Thanks!
Can you help answer these questions from other members on NexusFi?
I don't have NT installed anymore, but I would try adding the condition to the supertrend code and then replace the two parts highlighted here with that condition
Anyone feel free to correct me, but I think something like this will work,
My initial thought is that the strategy code is calculating before the supertrend has a chance to flip over and so it is entering and then immediately getting the signal to exit because the supertrend is still in the opposite state. In Sierra Chart you can control precedence to determine if this is the problem, but I am not sure how to do it in NT. Or...???
sam028, thanks. whereabouts in the code should I include this script? and what exactly would this help doing? I am just asking because I would like to learn
My initial thought is that the strategy code is calculating before the supertrend has a chance to flip over and so it is entering and then immediately getting the signal to exit because the supertrend is still in the opposite state. In Sierra Chart you can control precedence to determine if this is the problem, but I am not sure how to do it in NT. Or...???
it could be the case, but in theory the script should not action on the same timeframe, as it has a Position.MarketPosition check