TradeStation Back-testing/Intra-bar Order Generation/Slippage - TradeStation | futures io social day trading
futures io futures trading


TradeStation Back-testing/Intra-bar Order Generation/Slippage
Updated: Views / Replies:209 / 13
Created: by highlyimprobable 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 100,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
 

TradeStation Back-testing/Intra-bar Order Generation/Slippage

  #1 (permalink)
ridgewood, NJ
 
 
Posts: 13 since Aug 2019
Thanks: 8 given, 6 received

TradeStation Back-testing/Intra-bar Order Generation/Slippage

Some of my questions here is a continuation of my previous post here: https://futures.io/tradestation/48245-backtesting-ts-intrabarordergeneration.html

I am trying to automate a strategy on TS using its EasyLanguage. Previously, I used intrabarordergeneration (IOG) and with a 5-minute backtesting, the results looked great but as mtzimmer1 suggested in the post above, I switched the resolution to 1 tick over a month, and the results were pretty disappointing. (This is because I am using 5-minute intervals and my positions last anywhere from 5 min to 2 hours with an average of 50 minutes). I don't know if I am going to use IOG in the near future, and I understand that if I turn on IOG, the orders for entry/exit are placed at the next tick if the entry/exit conditions are satisfied. Something that I don't really understand from the description of IOG on the EasyLanguage page is the following:
If I have a moving average of the past 5 periods (5-minute intervals) and IOG is turned on, then how is it calculating the moving average? It is definitely not of the past 5 ticks, so is it taking each tick and then going back 5, 10, 15, 25 minutes and taking the average? If I am saying Close[1] is that the previous tick or the Close of the previous 5-minute bar?

Now, for my next question. So, I've turned IOG off except for my Stop Losses and Profit Targets. Every entry and exit that I have defined is executed
This Bar at Close
If IOG is turned off for entry/exit and I am running 5-minute intervals on my strategy, I would expect that back-testing at the 5-minute interval would not be much different than back-testing tick by tick except for slippage in my stop losses. Now, why is this completely wrong? I compare the back-testing and they are completely different. The 5-minute makes decent profit after commission over a few days while the tick by tick does not. Is this all slippage? It doesn't make sense for it to be this different since the backtesting should factor in High/Low for Stop Losses, right?


Last edited by highlyimprobable; September 2nd, 2019 at 08:17 PM.
Reply With Quote
 
  #2 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 257 since Dec 2018
Thanks: 368 given, 568 received

I'm not sure exactly why the difference in results is occurring but it usually has to do with how the strategy is coded. (What logic is used)

As far as the other question goes... IOG calculates the current price as the "close" until the bar itself actually closes. Say a five minute bar opens at 100.00. One minute in it has traded up to 100.24 and has satisfied the moving average condition; the order will be filled the moment the condition is met. We do not know what the close will be four minutes from now, and for that reason the tentative "close" is calculated as the last transacted tick.

I hope this answers at least half of your question.

-Zimmer

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to mtzimmer1 for this post:
 
  #3 (permalink)
ridgewood, NJ
 
 
Posts: 13 since Aug 2019
Thanks: 8 given, 6 received



mtzimmer1 View Post
I'm not sure exactly why the difference in results is occurring but it usually has to do with how the strategy is coded. (What logic is used)

As far as the other question goes... IOG calculates the current price as the "close" until the bar itself actually closes. Say a five minute bar opens at 100.00. One minute in it has traded up to 100.24 and has satisfied the moving average condition; the order will be filled the moment the condition is met. We do not know what the close will be four minutes from now, and for that reason the tentative "close" is calculated as the last transacted tick.

I hope this answers at least half of your question.

-Zimmer

Hi again Mr. Zimmer! Ah, so what you are saying is that with IOG on with your example (which my question is completely related to but I phrased terribly), when the moving average condition is satisfied, say at exactly 10:26:00 and for simplicity a simple moving average, the simple moving average calculation is (Price(10:26) + Price(10:21) + Price(10:16) + Price(10:11) + Price(10:06))/5, right?

I will check my strategy code again to see what the difference is, but you don't think slippage is the problem? I checked the first page of the trades list and I think the trades (time and position) were all the same in the 5-minute back-testing and the tick by tick except for the losses/profits.

Reply With Quote
 
  #4 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 257 since Dec 2018
Thanks: 368 given, 568 received


highlyimprobable View Post
when the moving average condition is satisfied, say at exactly 10:26:00 and for simplicity a simple moving average, the simple moving average calculation is (Price(10:26) + Price(10:21) + Price(10:16) + Price(10:11) + Price(10:06))/5, right?

Almost.

It is actually (Price(10:25) + Price(10:20) + Price(10:15) + Price(10:10) + Price(10:06))/5

It maintains the previous closes that have already been completed but uses last tick for the "close" of the currently un-closed bar.

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to mtzimmer1 for this post:
 
  #5 (permalink)
ridgewood, NJ
 
 
Posts: 13 since Aug 2019
Thanks: 8 given, 6 received


mtzimmer1 View Post
Almost.

It is actually (Price(10:25) + Price(10:20) + Price(10:15) + Price(10:10) + Price(10:06))/5

It maintains the previous closes that have already been completed but uses last tick for the "close" of the currently un-closed bar.

Do you mean

(Price(10:25) + Price(10:20) + Price(10:15) + Price(10:10) + Price(10:26))/5

instead because 10:25 to 10:30 is the un-closed 5-minute bar?

So, it actually gives more emphasis to more recent prices.

Reply With Quote
The following user says Thank You to highlyimprobable for this post:
 
  #6 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 257 since Dec 2018
Thanks: 368 given, 568 received

Answer
This post has been selected as an answer to the original posters question Answer


highlyimprobable View Post
Do you mean



(Price(10:25) + Price(10:20) + Price(10:15) + Price(10:10) + Price(10:26))/5



instead because 10:25 to 10:30 is the un-closed 5-minute bar?



So, it actually gives more emphasis to more recent prices.



Sorry for the error! Yes that is correct 10:26!

Emphasis should be equal to all five data points. Sum all five, and divide by five. Equal weighting!

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to mtzimmer1 for this post:
 
  #7 (permalink)
ridgewood, NJ
 
 
Posts: 13 since Aug 2019
Thanks: 8 given, 6 received


mtzimmer1 View Post
Sorry for the error! Yes that is correct 10:26!

Emphasis should be equal to all five data points. Sum all five, and divide by five. Equal weighting!

Yes, I understand the weighting is equal, but I meant more along the lines of the following reasoning. With IOG on, the SMA is taking an average of values that are closer to the current time than with IOG off, where we have an average is spaced evenly by 5 minutes.

Thanks for all your help!

Reply With Quote
 
  #8 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Trading Experience: Advanced
Platform: Tradestation
Broker/Data: Tradestation, DeCarley, others
Favorite Futures: futures
 
Posts: 2,632 since Jul 2012
Thanks: 1,356 given, 5,029 received

Answer
This post has been selected as an answer to the original posters question Answer

You can easily see what is going on with IBOG by using a print statement:

var:bl(" ");
print(date,bl,time,bl,close,bl,close[1],bl,close[2],bl,close[3],bl,close[4],bl,close[5]);

My experience with IBOG is limited, as years ago I found it did not backtest the way I though it should, and results were so puzzling at times I thought I'd lose my mind.

My hair stopped falling out (OK, more slowly fell out) once I gave up on IBOG...

Follow me on Twitter Reply With Quote
The following 2 users say Thank You to kevinkdog for this post:
 
  #9 (permalink)
ridgewood, NJ
 
 
Posts: 13 since Aug 2019
Thanks: 8 given, 6 received


kevinkdog View Post
You can easily see what is going on with IBOG by using a print statement:

var:bl(" ");
print(date,bl,time,bl,close,bl,close[1],bl,close[2],bl,close[3],bl,close[4],bl,close[5]);

My experience with IBOG is limited, as years ago I found it did not backtest the way I though it should, and results were so puzzling at times I thought I'd lose my mind.

My hair stopped falling out (OK, more slowly fell out) once I gave up on IBOG...

Ahahaha, I think I am about to close the chapter that is IBOG. It seems like there is a huge potential with IBOG, but understanding the intricacies of it might not be worth it. Do you have any ideas as to why the back-testing for 5-minute is significantly different from the tick by tick when IBOG is only turned on for stop losses and profit targets?

Yes, you are completely right about the Print function (I am so used to having the Print results next to my code when I execute it that I completely ignore it when I'm on TS).

Reply With Quote
 
  #10 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Trading Experience: Advanced
Platform: Tradestation
Broker/Data: Tradestation, DeCarley, others
Favorite Futures: futures
 
Posts: 2,632 since Jul 2012
Thanks: 1,356 given, 5,029 received



highlyimprobable View Post
Ahahaha, I think I am about to close the chapter that is IBOG. It seems like there is a huge potential with IBOG, but understanding the intricacies of it might not be worth it. Do you have any ideas as to why the back-testing for 5-minute is significantly different from the tick by tick when IBOG is only turned on for stop losses and profit targets?

Yes, you are completely right about the Print function (I am so used to having the Print results next to my code when I execute it that I completely ignore it when I'm on TS).

I could guess at what might be going on, but to really know I'd have to see the code in cases like this. (I'm not asking to see it, to be clear.)

The huge potential you see with IBOG is likely just tricks being played on the backtest engine. IN other words, not real.

Follow me on Twitter Reply With Quote
The following 2 users say Thank You to kevinkdog for this post:

Reply



futures io > > > > TradeStation Back-testing/Intra-bar Order Generation/Slippage

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

September
 

Webinar: The Best Entries and Exits in trading & in life w/Agustin Lebron

Elite only
 

Webinar: NinjaTrader 8 Newest Features Release Sneak Peek

Sep 26
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Intra-Bar Order Generation ivanyu MultiCharts 4 July 24th, 2015 12:16 PM
Intra bar order @ pre determined time jay j EasyLanguage Programming 9 October 1st, 2013 07:40 PM
Limit Order Discrepancy Live-Trading ag. Back-Testing sburtt Elite Automated NinjaTrader Trading 15 June 4th, 2013 01:29 AM
Trade intra-bar or at close of bar? r3algood The Elite Circle 7 October 4th, 2011 01:20 PM
Back to the Future! Back testing multi time frame strategy trades occuring in future mrticks The Elite Circle 10 April 2nd, 2011 09:54 AM


All times are GMT -4. The time now is 09:11 PM. (this page content is cached, log in for real-time version)

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