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)
does anyone know how to Easy language a research strategy where its entry at every single bar and then followed by a ATR trailing stop? Long only. And short only.
I think code below is a start... But I don't understand what ts is??
what exactly don't you understand regarding "ts"? It's just a variable, that could have (almost) any other name.
From the code it appears to be holding the value of a trailing stop, hence the abbreviation "ts" was probably used for its name.
It will hold either of the two values below, depending on the trend (as computed by the study).
When the TriggerPrice variable is less than the previous bars value for ts, then the study will assume that a down trend exists and update the ts variable following this logic:
by the way you can show your appreciation for posts on nexusfi.com by clicking the "Thanks" button next to the code.
An entry on every (!) bar will require a bit of work most likely as you have to deal with pyramiding and scaling out of positions. Do you actually want that or do you want to enter only again when flat?
Feel free to post your code attempts and I am sure someone is able to steer you in the right direction.