NexusFi: Find Your Edge


Home Menu

 





Back tests not running on all downloaded data


Discussion in TradeStation

Updated
    1. trending_up 2,304 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
Search this Thread

Back tests not running on all downloaded data

  #1 (permalink)
 Iluvchocmilk 
Portland
 
Experience: Beginner
Platform: TradingView
Broker: Tradestation
Trading: Emini ES
Posts: 49 since Jul 2020
Thanks Given: 32
Thanks Received: 37

Hey Everyone,

I am trying run a walk forward analysis on TS and I have downloaded 4 yrs. of MES 1440min data. All the data shows up in my chart analysis window but when I run my test it only uses ~50% of my data.

There are no time based bits in my code, I tried reloading the data with the same result and I have "all data" selected in the dropdown.

I've tried other strategies on the data too with the same results.

I've only recently started testing on daily bars so I'm wondering if it has something to do with that...Maybe the data only goes so far back BUT it shows up visually just not taking any trades.

Code is simple:

Inputs: StopAmt(40), ProfitAmt(40), SlowMaLength(50), MidMaLength(21), FastMaLength(9), ATRlength(10);

Vars: SlowMa(0), LongCondition(0), ShortCondition(0), MidMa(0), FastMa(0), ATR(0);

SlowMa = Average(close, SlowMaLength); MidMa = average(close, MidMaLength); FastMa= Average(close, FastMaLength);

if (close>high[1] and close[1]>high[2]) then
Buy("Long") 1 contract next bar at Market;


SetStopLoss(StopAmt);
SetProfitTarget(ProfitAmt);

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Iluvchocmilk,

what value are using for "Maximum number of bars study will reference" in the general strategy properties?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 Iluvchocmilk 
Portland
 
Experience: Beginner
Platform: TradingView
Broker: Tradestation
Trading: Emini ES
Posts: 49 since Jul 2020
Thanks Given: 32
Thanks Received: 37



ABCTG View Post
Iluvchocmilk,

what value are using for "Maximum number of bars study will reference" in the general strategy properties?

Regards,

ABCTG

I think I had it set at 200 - that's definitely worth checking. Hopefully it's that simple. I'll check tonight.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Iluvchocmilk,

that would at least account for 200 bars, but based on your description of "it only uses ~50% of my data" I am not sure if this is it.
Did lowering the Max bars back number change the behavior on your end and do you see more trades now?

Regards,

ABCTG


Iluvchocmilk View Post
I think I had it set at 200 - that's definitely worth checking. Hopefully it's that simple. I'll check tonight.


Follow me on Twitter Reply With Quote
  #5 (permalink)
 Iluvchocmilk 
Portland
 
Experience: Beginner
Platform: TradingView
Broker: Tradestation
Trading: Emini ES
Posts: 49 since Jul 2020
Thanks Given: 32
Thanks Received: 37


ABCTG View Post
Iluvchocmilk,

that would at least account for 200 bars, but based on your description of "it only uses ~50% of my data" I am not sure if this is it.
Did lowering the Max bars back number change the behavior on your end and do you see more trades now?

Regards,

ABCTG

Yeah, I increased the bars back in the properties tab and seems to have resolved the issue. Of course I was messing with a lot of things so it's hard to 100% attribute it to that though I'm it had something to do with it. I'm currently re-installing TS since I lost a bunch of the fields in the optimization report - they disappeared and I couldn't add them back in from their list... fun fun fun

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Iluvchocmilk,

we might be misunderstanding each other. A decrease in the number should make more data available in case Max Bars Back was the culprit. Increasing the number would result in even more bars not being available for strategy calculations. The name the developers used can be a bit misleading, apart from this feature being one of the most misunderstood within Tradestation. You might benefit from the information in this wiki link as it gives some good examples and clarifies everything you need to know about this feature:
https://community.tradestation.com/wiki/display/EasyLanguage/Understanding+MaxBarsBack

Regards,

ABCTG


Iluvchocmilk View Post
Yeah, I increased the bars back in the properties tab and seems to have resolved the issue. Of course I was messing with a lot of things so it's hard to 100% attribute it to that though I'm it had something to do with it. I'm currently re-installing TS since I lost a bunch of the fields in the optimization report - they disappeared and I couldn't add them back in from their list... fun fun fun


Follow me on Twitter Reply With Quote
  #7 (permalink)
 Iluvchocmilk 
Portland
 
Experience: Beginner
Platform: TradingView
Broker: Tradestation
Trading: Emini ES
Posts: 49 since Jul 2020
Thanks Given: 32
Thanks Received: 37


ABCTG View Post
Iluvchocmilk,

we might be misunderstanding each other. A decrease in the number should make more data available in case Max Bars Back was the culprit. Increasing the number would result in even more bars not being available for strategy calculations. The name the developers used can be a bit misleading, apart from this feature being one of the most misunderstood within Tradestation. You might benefit from the information in this wiki link as it gives some good examples and clarifies everything you need to know about this feature:
https://community.tradestation.com/wiki/display/EasyLanguage/Understanding+MaxBarsBack

Regards,

ABCTG

I am getting a "this page isn't working error" when trying to check out the link above.

My understanding is that you need the maxbarsback setting set based on any lookback period you may have in your code. i.e. if you have a 200 MA you need to be referencing 200 or more bars back. That seems fairly intuitive to me so maybe I am still misunderstanding it haha



Link to screen shot: Maximum Number of Bars Study Will Reference Setting

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #8 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Iluvchocmilk,

the link appears to work for me, but you should be able to find the page in the Wiki directly, too.
Based on your description it sounds like you are understanding the feature correctly.

Regards,

ABCTG


Iluvchocmilk View Post
I am getting a "this page isn't working error" when trying to check out the link above.

My understanding is that you need the maxbarsback setting set based on any lookback period you may have in your code. i.e. if you have a 200 MA you need to be referencing 200 or more bars back. That seems fairly intuitive to me so maybe I am still misunderstanding it haha



Link to screen shot: Maximum Number of Bars Study Will Reference Setting


Follow me on Twitter Reply With Quote




Last Updated on August 3, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts