Trade Restriction for Certain Time Period After Stopping Out - EasyLanguage Programming | futures io social day trading
futures io futures trading


Trade Restriction for Certain Time Period After Stopping Out
Updated: Views / Replies:593 / 4
Created: by el oso 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
 

Trade Restriction for Certain Time Period After Stopping Out

  #1 (permalink)
Elite Member
Jersey City, NJ, USA
 
Futures Experience: Intermediate
Platform: MultiCharts, IB
Favorite Futures: ES
 
Posts: 4 since May 2015
Thanks: 1 given, 1 received

Trade Restriction for Certain Time Period After Stopping Out

Hi all,

First post here! I am trying to write a piece of EasyLanguage code intended for risk mitigation in my automated strategy, and I'm stumped. What I'm trying to do is: If a stop order is executed, I would like to have a "blackout period" during which no trade entries in that same direction will be made.

For example, say I am using a 15-min chart and my strategy is long 3 ES contracts. Then, the price drops and triggers my stop loss order for the 3 contracts, so I am now flat. I would like the strategy to not be permitted to enter into any new long positions for the next hour.

I think the best way to do this would be to have a condition that evaluates to "true" if the strategy has been stopped out of a long trade in the past hour, and have the "new orders" command be conditional on that condition being "false".

However, I have not been able to figure out a way to check if a stop order has been triggered in the past hour (and if there is a way to determine this, how to differentiate between a "sell" stop order and a "buy to cover" stop order).

Please let me know if you have encountered a similar problem before or know of a solution.

Thank you!
el oso


Last edited by el oso; July 22nd, 2015 at 09:26 AM.
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)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,527 since Apr 2013
Thanks: 229 given, 854 received
Forum Reputation: Legendary


el oso,

welcome to the forum. Can you post the code you have written so far? This might make it easier to steer you in the right direction.

Regards,
ABCTG

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,527 since Apr 2013
Thanks: 229 given, 854 received
Forum Reputation: Legendary

el oso,

sorry for the confusion, I wasn't interested in your whole strategy, only the part you did so far for the feature you are asking for.
I would try something along the lines of this:

- use a boolean variable that you check before you enter long (something like "newLongsAllowed" for example)
- when the market position changes from long to short/flat, check if the trade was a loser and was exited at your stop price
- if this is the case set the variable newLongsAllowed to false and store the time of the bar in a second variable
- the last thing to do is check if the time of the current bar is later than the stored time + 1 hour
- at that moment you set the newLongsAllowed back to true so the system can take a new long entry

This should get you going.

Regards,
ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #5 (permalink)
Elite Member
Jersey City, NJ, USA
 
Futures Experience: Intermediate
Platform: MultiCharts, IB
Favorite Futures: ES
 
Posts: 4 since May 2015
Thanks: 1 given, 1 received


ABCTG View Post
el oso,

sorry for the confusion, I wasn't interested in your whole strategy, only the part you did so far for the feature you are asking for.
I would try something along the lines of this:

- use a boolean variable that you check before you enter long (something like "newLongsAllowed" for example)
- when the market position changes from long to short/flat, check if the trade was a loser and was exited at your stop price
- if this is the case set the variable newLongsAllowed to false and store the time of the bar in a second variable
- the last thing to do is check if the time of the current bar is later than the stored time + 1 hour
- at that moment you set the newLongsAllowed back to true so the system can take a new long entry

This should get you going.

Regards,
ABCTG

Thank you, ABCTG! This is very helpful, and I will try it out. Yeah, I had not written any code yet for this feature, as I was not sure where to start / what is possible, so this is what I was looking for.

Reply With Quote

Reply



futures io > > > > > Trade Restriction for Certain Time Period After Stopping Out

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
pivotindicator for a time period tulasi MetaQuotes MetaTrader MQL Programming 5 October 13th, 2015 02:36 AM
Display SMA from another time period buckdharma NinjaTrader 6 February 13th, 2015 08:02 AM
H/L FOR A SPECIFIC PERIOD OF TIME FKtrader NinjaTrader 2 October 20th, 2013 12:30 PM
bool off after a period of time toddma EasyLanguage Programming 2 March 22nd, 2013 05:41 AM
Stopping ETD (End of Trade drawdown) with classic Donchian Channels strategies drolles NinjaTrader Programming 2 December 23rd, 2010 01:00 PM


All times are GMT -4. The time now is 07:53 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-12 in 0.12 seconds with 19 queries on phoenix via your IP 54.234.255.29