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)
Setting StopLosses and ProfitTargets without using actual dollar amounts
I'm trying to write a strategy for trading the ES emini futures contract (e.g., ESZ3), but am having trouble setting Stop Losses and Profit Targets.
Many posts I've seen on the web focus on setting Stops and Profits based on actual dollar amounts. For example, Stopping out if the trade goes $200 against me, and Taking Profit if the trade goes $800 in my favor. The typical SetStopLoss (200) and SetProfitTarget (800) would be used.
However, what if I want to set my Stop and Profit based on values of previous bars?
1. For example, what if I want to set my Stop at High[1] (i.e., high of the previous bar)?
2. Also, what if I want to set my Target at Close[1] - 8 points of the contract? (That is, I want my Target to be hit after price goes 8 points (or $400) below the close of the previous bar?
I can't seem to figure out how to set this using the SetStopLoss and SetProfitTarget functions.
Any help is appreciated!
-K
Can you help answer these questions from other members on NexusFi?
One way to do this would be to not use the setProfitTarget and setStopLoss methods. Instead just use sell next bar at n limit/stop etc. syntax.
You could write:
You could write:
Of course, you would want additional checks like if you are in a position or not etc. before you direct your strategy to place an order. Hope this gives you some ideas.
I am completely new to EasyLanguage and programming in general. I am hoping someone could help me set a trailing stop loss which is not measured in $ but in %. In other words, I want to exit a long position if it falls by 1% from its highest point after entry, as opposed to it falling by 1$. Please note that it's different from 'SetPercentTrailing' as it allows you to specify a percentage stop loss only relative to a certain $ profit level. I have tried the following code to exit a long position but it doesn't work:
Also how would you do such a trailing stop loss to exit a short position?
I have managed to find an extremely powerful stop loss strategy that does offer a % trailing stop loss, including many other sophisticated features. It looks quite exciting! However, as a user of MultiCharts, I can't use this code as it's written for TradeStation, which seems to be using a more up-to-date version of EasyLanguage than MultiCharts. For example, when I compile it in MultiCharts the editor doesn't understand "Method void", "#region", etc. I have already found on Big Mike forum how to deal with the 'method void' problem (bigmiketrading.com/easylanguage-programming/14181-tradestation-9-easylanguage-multi-charts-easy-language.html), but my programming skill is so poor that I don't really understand the suggested solution.
Would there be anyone kindhearted enough to help me out here please
The description and the code for the stop loss strategy I found is here: hightick.com/Tradestation/Strategy/StopsFlexible/index.html