help with automated exits - TradeStation | futures io social day trading
futures io futures trading


help with automated exits
Updated: Views / Replies:892 / 3
Created: by maggtrading 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
 

help with automated exits

  #1 (permalink)
Trading Apprentice
méxico df, méxico
 
Futures Experience: Advanced
Platform: ninjatrader, tradestation
Broker/Data: demo so far
Favorite Futures: stocks, fdax, fdxm, fesx, rb, ho, ng, cl, tf, nq, bp, ec, jy
 
Posts: 46 since Mar 2013
Thanks: 115 given, 21 received

help with automated exits

hello there.


i have been using an automated strategy for tradestation for a couple of weeks now. it does ok, but i would like to improve the exits i have as of now. i will post these questions in the tradestation community forums too, but i could get some pointers here as there are accomplished easylanguage programmers in bmt too, and the ts forum is down as of now.


i would like my strategy to go with the trend; buy a stock when the price is above a simple moving average and other indicators are pointing upwards, and sell it when it is below the sma.


my code for long positions looks like this now:



if Price >= AverageFC( Price, Length ) and -another condition- then begin


Buy PSize Shares next bar at market ;


Avg = AverageFC( Price, Length ) ;


if Price < Avg then


Sell all shares next bar at market ;

end;



entries work ok, but i don't like how the exits behave right now. let's say it buys, it is all well, but it should drop the position as soon as the price is below the sma, yet i have seen my strategy hold onto positions that have crossed the sma down and only close them when it is opening a reverse position. it only closes a long position when it opens a short position and viceversa. i would like the strategy to hold positions only when they are outside the sma. how would code look like to achieve this?



and a second question, if i wanted a strategy to exit as soon as two consecutive bars have gone against my position, how would code look like to achieve this?


i tried:


If ( Price [2] > Price [1] and Price [1] > Price ) then

Sell all shares next bar at market ;


but seemingly it won't work.


any guidance will be appreciated, thanks, regards.

Reply With Quote
 
  #2 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,139 given, 4,387 received
Forum Reputation: Legendary


maggtrading View Post

and a second question, if i wanted a strategy to exit as soon as two consecutive bars have gone against my position, how would code look like to achieve this?


i tried:


If ( Price [2] > Price [1] and Price [1] > Price ) then

Sell all shares next bar at market ;


but seemingly it won't work.


any guidance will be appreciated, thanks, regards.


If close<close[1] and close[1]<close[2] then sell all shares next bar at market;


should work for 2 consecutive lower closes.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
  #3 (permalink)
Trading Apprentice
méxico df, méxico
 
Futures Experience: Advanced
Platform: ninjatrader, tradestation
Broker/Data: demo so far
Favorite Futures: stocks, fdax, fdxm, fesx, rb, ho, ng, cl, tf, nq, bp, ec, jy
 
Posts: 46 since Mar 2013
Thanks: 115 given, 21 received



kevinkdog View Post
If close<close[1] and close[1]<close[2] then sell all shares next bar at market;


should work for 2 consecutive lower closes.




thanks. let me try it out, in inputs i'm already using price on close but will check out your code.

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
méxico df, méxico
 
Futures Experience: Advanced
Platform: ninjatrader, tradestation
Broker/Data: demo so far
Favorite Futures: stocks, fdax, fdxm, fesx, rb, ho, ng, cl, tf, nq, bp, ec, jy
 
Posts: 46 since Mar 2013
Thanks: 115 given, 21 received

solved.



removing the begin and end cycle, leaving the entries and exits like this:


if Price >= AverageFC( Price, Length ) and -another condition- then


Buy PSize Shares next bar at market ;


Avg = AverageFC( Price, Length ) ;


if Price < Avg then


Sell all shares next bar at market ;




the strategy now drops positions when the exit conditions are met. and, with these changes, the two consecutive lows also work.

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

Reply



futures io > > > > help with automated exits

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
Exits and Exit Strategies! plethora The Elite Circle 13 March 5th, 2015 12:48 AM
NWT Exits Suite NW27 Elite EasyLanguage Automated Trading 6 November 25th, 2012 06:20 AM
Automated entries, exits, stops and targets..Without a single line of code! Alex91320 NinjaTrader 0 August 14th, 2012 05:29 PM
Exits,the major puzzle? joyginy Traders Hideout 17 August 18th, 2010 07:19 AM


All times are GMT -4. The time now is 10:46 PM.

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-14 in 0.11 seconds with 20 queries on phoenix via your IP 54.90.207.75