Entry at every bar, exit ATR trailing - MultiCharts | futures io social day trading
futures io futures trading


Entry at every bar, exit ATR trailing
Updated: Views / Replies:446 / 3
Created: by Loop 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
 

Entry at every bar, exit ATR trailing

  #1 (permalink)
Elite Member
Sydney
 
Futures Experience: Intermediate
Platform: Multichart
Favorite Futures: Gold
 
Posts: 26 since Aug 2016
Thanks: 22 given, 4 received

Entry at every bar, exit ATR trailing

Hola

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

Kind regards

Loop



Inputs: Price(Close),atrPeriod(14),atrMult(1.75);

Vars:
atr(0), ts(0), shstp(0), lgstp(0), trend(0), TriggerPrice(0), dir(0);

atr = AvgTrueRange(AtrPeriod);

lgstp = Price - atr * atrMult;
shstp = Price + atr * atrMult;

TriggerPrice = close;

if TriggerPrice >= ts[1] then
trend = 1
else if TriggerPrice < ts[1] then
trend = -1;

if trend > 0 then
if trend[1] < 0 then ts=lgstp[0]
else if lgstp >= ts[1] then ts=lgstp[0]
else ts=ts[1];

if trend < 0 then
if trend[1] > 0 then ts=shstp[0]
else if shstp <= ts[1] then ts=shstp[0]
else ts=ts[1];

if trend[1] < 0 and trend >= 0 then buy next bar at market;
if trend[1] > 0 and trend < 0 then sellshort next bar at market;

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 854 received
Forum Reputation: Legendary

Loop,

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).
 
Code
lgstp = Price - atr * atrMult;
shstp = Price + atr * atrMult;
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:
 
Code
if trend < 0 then
if trend[1] > 0 then ts=shstp[0]
else if shstp <= ts[1] then ts=shstp[0]
else ts=ts[1];
It will be vice versa for an up trend.

Regards,

ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #3 (permalink)
Elite Member
Sydney
 
Futures Experience: Intermediate
Platform: Multichart
Favorite Futures: Gold
 
Posts: 26 since Aug 2016
Thanks: 22 given, 4 received

Entry


Thank you for heads up!!

Any idea how to have an entry at every bar in order to do trend research?

Reply With Quote
 
  #4 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 854 received
Forum Reputation: Legendary

Loop,

by the way you can show your appreciation for posts on futures.io 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.

If you are looking for someone to code it for you, you might be able to find help in the "Want your EasyLanguage Indicator Created free" thread.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:

Reply



futures io > > > > Entry at every bar, exit ATR trailing

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
Order Entry, Target, Trailing Stop, and Exit DrRon EasyLanguage Programming 18 November 24th, 2015 02:43 PM
Trailing Stop based on ATR rahulgopi TradeStation 3 October 9th, 2014 11:51 PM
Place text at order entry/exit bar ivanyu EasyLanguage Programming 2 August 5th, 2013 07:20 AM
ATR Trailing Stop Parameter Optimization tbmuc Elite Automated Trading 2 November 29th, 2012 04:52 PM
a simple entry exit bar johni EasyLanguage Programming 7 July 23rd, 2011 05:34 AM


All times are GMT -4. The time now is 08:34 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-15 in 0.12 seconds with 19 queries on phoenix via your IP 54.234.247.118