Exit at end of trading day on 5 minute bars - futures io
futures io futures trading



Exit at end of trading day on 5 minute bars


Discussion in EasyLanguage Programming

Updated
    1. trending_up 950 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

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

 
Search this Thread
 

Exit at end of trading day on 5 minute bars

(login for full post details)
  #1 (permalink)
Gothenburg Sweden
 
 
Posts: 48 since Jul 2019
Thanks: 40 given, 17 received

Hi

I was looking for the best way to exit trades close to the end of the day (3.15 pm) on intraday strategies that uses 5 minute bars.

So far I have been using "setexitonclose" together with a session that goes from 8.30 am-3.09 pm. To my understanding this would then exit the trade on the next bar that is 3.10 pm.

Now let's say I want to exit at 3.14 pm instead. How would I achieve this the best way possible? I was thinking about making a session from 8.30 - 3.14 and in the code write "If time > 1511 then sell this bar on close". Would this then close the trade at the session close (3.14 pm) or not?

Regards

Reply With Quote

 
Best Threads (Most Thanked)
in the last 7 days on futures io
The Small Exchange (www.smallexchange.com)
106 thanks
Big Mike in Ecuador
85 thanks
How did you learn to trade?
59 thanks
Whos afraid of the big bad Glitch
51 thanks
Spoo-nalysis ES e-mini futures S&P 500
42 thanks
 
(login for full post details)
  #2 (permalink)
Legendary Market Wizard
Cleveland Ohio/United States
 
Experience: Advanced
Platform: Tradestation
Broker: Tradestation, DeCarley, others
Trading: futures
 
Posts: 2,917 since Jul 2012
Thanks: 1,535 given, 5,718 received


Prophet85 View Post
Hi

I was looking for the best way to exit trades close to the end of the day (3.15 pm) on intraday strategies that uses 5 minute bars.

So far I have been using "setexitonclose" together with a session that goes from 8.30 am-3.09 pm. To my understanding this would then exit the trade on the next bar that is 3.10 pm.

Now let's say I want to exit at 3.14 pm instead. How would I achieve this the best way possible? I was thinking about making a session from 8.30 - 3.14 and in the code write "If time > 1511 then sell this bar on close". Would this then close the trade at the session close (3.14 pm) or not?

Regards

That should work, it should exit at at 3:14 PM.

After you backtest it, I suggest running in real time, preferably real account, just to test and make sure it is working correctly. I have seen times where this does not always work properly.

Follow me on Twitter Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #3 (permalink)
Gothenburg Sweden
 
 
Posts: 48 since Jul 2019
Thanks: 40 given, 17 received



kevinkdog View Post
That should work, it should exit at at 3:14 PM.

After you backtest it, I suggest running in real time, preferably real account, just to test and make sure it is working correctly. I have seen times where this does not always work properly.

Thank you! Yeah I will test it live. I know the method of using "sell this bar on close" works well with bar building of daily bars (405 minute bars) with a session (8.30 - 15.14). But I always thought that is because the bars use smaller 1 minute intervals to build the full bars. This means that Tradestation can do proper backtesting as it could calculate the exit price at 15.14.

I just don't know how it would know the exit price at 15.14 if I do backtesting at 5 minutes bars since TS would only know the price at 15.15. Or would I have to use "look-inside-bar" for the backtesting to work properly?

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Legendary Market Wizard
Cleveland Ohio/United States
 
Experience: Advanced
Platform: Tradestation
Broker: Tradestation, DeCarley, others
Trading: futures
 
Posts: 2,917 since Jul 2012
Thanks: 1,535 given, 5,718 received


Prophet85 View Post
Thank you! Yeah I will test it live. I know the method of using "sell this bar on close" works well with bar building of daily bars (405 minute bars) with a session (8.30 - 15.14). But I always thought that is because the bars use smaller 1 minute intervals to build the full bars. This means that Tradestation can do proper backtesting as it could calculate the exit price at 15.14.

I just don't know how it would know the exit price at 15.14 if I do backtesting at 5 minutes bars since TS would only know the price at 15.15. Or would I have to use "look-inside-bar" for the backtesting to work properly?

If you create a custom session, the last bar should end at 15:14, so then TS would know the proper price to use.

I know that works in backtest, I have heard and seen mixed reviews on how well this works live.

Follow me on Twitter Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #5 (permalink)
Gothenburg Sweden
 
 
Posts: 48 since Jul 2019
Thanks: 40 given, 17 received


kevinkdog View Post
If you create a custom session, the last bar should end at 15:14, so then TS would know the proper price to use.

I know that works in backtest, I have heard and seen mixed reviews on how well this works live.

Ok, great! I will try it out and see how it goes.

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Exit at end of trading day on 5 minute bars


Last Updated on January 3, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge!

February
 

Battlestations!

March
     



Copyright © 2021 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