Day Trade Script Backtesting Questions - ThinkOrSwim Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming

Day Trade Script Backtesting Questions
Started:March 11th, 2016 (12:59 PM) by ArbitrageCapital Views / Replies:208 / 0
Last Reply:March 11th, 2016 (12:59 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Day Trade Script Backtesting Questions

Old March 11th, 2016, 12:59 PM   #1 (permalink)
Trading Apprentice
San Francisco
Futures Experience: None
Platform: TOS
Favorite Futures: Equity
Posts: 1 since Mar 2016
Thanks: 0 given, 0 received

Day Trade Script Backtesting Questions

Hi All,

I want to write a code that allows me to backtest a day trading strategy. To be specific, I am concerned with just the first 4 bars of each trading day using the 10 minute bar (09:30 - 10:00). The issue I have is the code I have will produce meaningful results if I ran the code today for todays trading session but If I ran the code today for yesterdays price action, the code won't produce meaningful results. I think the issue is with the date parameter?

How can I adjust the code such that the code will only look at the price action of the 0930, 0940, 0950, and 10:00
bar for any trading day? Ideally, I'd like to just change the date parameter when I do my backtesting.

Here is my code. Its a simple inside bar setup. I want to be able to back test the code for day trades using the 10 minute bar. Thanks!

Input Bar_1 = 3;
Input Bar_2 = 2;
Input Bar_3 = 1;
Input Bar_4 = 0;

Input Vol = Volume;
Input Price = Close;
Input High_P = High;
Input Low_P = Low;

Input Length = 26;
Input Increase = 50;

Def AVG_Vol = average(Vol, Length);
Def Change_Vol = 100*(Vol[Bar_1] / Avg_Vol - 1);

Def RegularMarketHours = secondsFromTime(930) >= 0 and secondsTillTime(1600)>=0;

Def TradingDay = GETYYYYMMDD() ;

Plot Scan;

Scan =

Price[Bar_4] < High_P[Bar_1]
and Price[Bar_4] > Low_P[Bar_1]

and Price[Bar_3] < High_P[Bar_1]
and Price[Bar_3] > Low_P[Bar_1]

and Price[Bar_2] < High_P[Bar_1]
and Price[Bar_2] > Low_P[Bar_1]

and Change_Vol > Increase
AND RegularMarketHours
AND TradingDay


Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming > Day Trade Script Backtesting Questions

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit Strategy backtesting based on time of day blenderking NinjaTrader Programming 4 July 2nd, 2016 10:23 AM
Yet another newbie day trading questions jp94 Beginners and Introductions 14 June 22nd, 2014 04:50 PM
Before You Take That Trade: Strategic and Tactical Questions Anagami Psychology and Money Management 7 April 27th, 2013 10:48 AM
An alert that will talk to me during the day with trade questions, help? hector24 NinjaTrader 35 July 3rd, 2012 07:47 AM
Multicharts backtesting and optimization ramblings/questions.. benharrell Elite EasyLanguage Automated Trading 4 June 28th, 2012 06:25 PM

All times are GMT -4. The time now is 03:55 PM.

Copyright © 2016 by 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 2016-10-22 in 0.08 seconds with 19 queries on phoenix via your IP