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)
Hello, lately i was thinking and can't figure it out, how can I place specific SL/TP for specific entries? I mean I have one strategy file where I defined 2 types of entries:
1) mean reversion and
2) trend following.
And for every type of entry I want to define specific SL/TP parameters. From my present knowledge of PowerLanguage I can’t figure it out. If I type something like:
in this case I’m telling EL about every long position, without distinction on strategy 1 or 2. Maybe there is some possibility to use names of the entry…
The only thing I can handle it right now is by creating new strategy(file) for every strategy
Thanks, Alex
Can you help answer these questions from other members on NexusFi?
and what about setstoploss_pt() and setprofittarget_pt()? I mean i have 2 strategies one is for long side and one is for the short side. Each have specific ST and SL settings, but when i put them both on the chart to autotrade, when position is open TP and SL are applied from 2 strategy files.
I was thinking on using only one strategy file, but then again, is that possible to use setstoploss_pt() and setprofittarget_pt() with it? Or just to use something like: "sell ("....") entry(".....") next bar entryprice+8 limit"?
for that situation you would either have to combine both strategies into one code and only use one set of setstoploss_pt() and setprofittarget_pt() (or remove setstoploss_pt() and setprofittarget_pt() from the two strategies and place it within a third separate strategy that you add to the same chart). You could use different inputs for the two reserved words depending on the market position, but this might result in your entries still using the inputs from the previous trade during the entry bar.
However, it might be the better approach to specifically code target and stop exits for each entry using actual orders.