Setting StopLosses and ProfitTargets without using actual dollar amounts - EasyLanguage Programming | futures io social day trading
futures io futures trading


Setting StopLosses and ProfitTargets without using actual dollar amounts
Updated: Views / Replies:2,349 / 5
Created: by minntabo Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Setting StopLosses and ProfitTargets without using actual dollar amounts

  #1 (permalink)
Trading Apprentice
new york, ny
 
Futures Experience: Intermediate
Platform: oec
Favorite Futures: es
 
Posts: 5 since Sep 2013
Thanks: 1 given, 0 received

Setting StopLosses and ProfitTargets without using actual dollar amounts

Hi all,

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

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Trading for Profit
Houston, TX
 
Futures Experience: Intermediate
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: CL
 
LogicalTrader's Avatar
 
Posts: 294 since Aug 2013
Thanks: 1,420 given, 752 received


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.


Quoting 
1. For example, what if I want to set my Stop at High[1] (i.e., high of the previous bar)?

You could write:

 
Code
If (<your condition here, mostly the bar you entered at or whatever decides your stop>) then
Value1 = High[1];

Buy Cover next bar at Value1 stop;

Quoting 
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?

You could write:

 
Code
if (<my condition>) then
Value1 = Close[1] - 8;

Sell next bar at Value1 limit;


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.

There are some great free tutorials at Free Tutorials for EasyLanguage Services for TradeStation if you want to take a look.

Hope this helps.

Reply With Quote
The following user says Thank You to LogicalTrader for this post:
 
  #4 (permalink)
Trading Apprentice
new york, ny
 
Futures Experience: Intermediate
Platform: oec
Favorite Futures: es
 
Posts: 5 since Sep 2013
Thanks: 1 given, 0 received

Thanks iNeo for the tips. Everything seems to be working. I'll keep posted on results.

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
London
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Futures
 
Posts: 2 since Oct 2013
Thanks: 0 given, 0 received

% trailing stop loss

Hello,

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:

 
Code
[IntrabarOrderGeneration = False]
inputs: PositionBasis( false ), TrailStopPct ( 1 ) {enter in percentage points} ;

variables: StopCalc (0) ;

if PositionBasis then
    SetStopPosition
else
    SetStopShare ;

StopCalc = Close - Close * TrailStopPct * 0.01 ;

if Close < = StopCalc then
    Sell next bar at market ;
Also how would you do such a trailing stop loss to exit a short position?

Any help would be much appreciated!

Alex

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
London
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Futures
 
Posts: 2 since Oct 2013
Thanks: 0 given, 0 received

Hello again!

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

Cheers!
Alex

Reply With Quote

Reply



futures io > > > > > Setting StopLosses and ProfitTargets without using actual dollar amounts

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Matlab for backtesting large amounts of tick data Big Mike Matlab, R project and Python 2 September 11th, 2013 07:13 AM
SetShowOnly question about actual effectiveness silver99 EasyLanguage Programming 1 December 23rd, 2012 10:28 AM
Cesium-137 contamination: Fukushima amounts to four Chernobyls kbit News and Current Events 1 May 24th, 2012 10:51 PM
Actual Transparent Windows SuperBliss Trading Reviews and Vendors 4 October 14th, 2010 02:25 PM
Bug in the actual NT7.0.0.14 Trendseek NinjaTrader Programming 1 April 29th, 2010 06:59 AM


All times are GMT -4. The time now is 11:18 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-13 in 0.11 seconds with 19 queries on phoenix via your IP 54.227.51.103