UpTick/Downtick Calculations - EasyLanguage Programming | futures.io
futures.io futures trading

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming

UpTick/Downtick Calculations
Started:January 7th, 2012 (01:13 PM) by clement Views / Replies:3,409 / 3
Last Reply:January 13th, 2012 (01:14 AM) Attachments:0

Welcome to futures.io.

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

UpTick/Downtick Calculations

Old January 7th, 2012, 01:13 PM   #1 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: IB/IQFeed
Favorite Futures: YM
clement's Avatar
Posts: 6 since Dec 2011
Thanks: 3 given, 0 received

UpTick/Downtick Calculations

Hi guys,

I wrote a short snippet to count the number of upticks and downticks in Multicharts. I wrote this as I am not sure the default "UpTicks" and "DownTicks" reserved keyword does what it is suppose to, which is to count UpTicks as the number of ticks that are done at a higher price then the tick immediately preceding it and vice-versa for DownTicks. I am unsure because UpTicks + DownTicks = Ticks, which means that each tick is always higher or lower than the preceding tick and that there are no ticks that are done at the same price at the preceding tick. I'm not sure what the UpTicks and DownTicks values are counting, if somebody could clarify it would be greatly appreciated. Anyways, I wrote the short code snippet below but I cannot get it to update properly on a 100-tick chart. I want to count all the upticks within the 100-tick chart. It looks like if the 100-tick chart moves up, upticks only go up by one, instead of all the upticks withing the 100-tick bar. It is also incredibly slow to calculate. Do I have some big inefficiency in my code? Or is what I am asking just really too much to calculate in real-time?

    UpColor( Green ),
    DownColor( Red ),
    DailyReset( true );
    intrabarpersist UpTick( false ),
    intrabarpersist DownTick( false ),
    intrabarpersist avgTicks( 0 ),
    intrabarpersist cumulativeTicks( 0 ),
    intrabarpersist upTickCount( 0 ),
    intrabarpersist downTickCount( 0 );
once cleardebug;

if DailyReset and time = 0630 then cumulativeTicks = 0;

UpTick = close > close[ 1 ];
DownTick = close < close[ 1 ];

if UpTick then UpTickCount = upTickCount[ 1 ] + 1;
if DownTick then DownTickCount = downTickCount[ 1 ] + 1;

if UpTick then cumulativeTicks = cumulativeTicks[ 1 ] + 1;
if DownTick then cumulativeTicks = cumulativeTicks[ 1 ] - 1;

avgTicks = XAverage( cumulativeTicks, 3 );

print( "========= Bar ", currentbar );
print( "UpTicks: ", upTickCount, "; DownTicks: ", downTickCount );
print( "CumulativeTicks: ", cumulativeTicks ); 

Plot1( cumulativeTicks, "Cumulative Ticks" );
Plot2( UpTickCount, "UpTick Count" );
plot3( DownTickCount, "DownTick Count" );

condition1 = UpColor >= 0 and DownColor >= 0;
if condition1 then
        value1 = NormGradientColor( cumulativeTicks, true, 14, UpColor, DownColor );
        SetPlotColor( 1, value1 );
Many thanks,

Reply With Quote

Old January 7th, 2012, 01:13 PM   #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.


Old January 8th, 2012, 05:37 PM   #3 (permalink)
Elite Member
Futures Experience: Advanced
Platform: MultiCharts, MT4, NT
Favorite Futures: EUR/USD
Squib's Avatar
Posts: 4 since Jan 2012
Thanks: 4 given, 1 received

clement View Post
Hi guys,
I'm not sure what the UpTicks and DownTicks values are counting, if somebody could clarify it would be greatly appreciated.

Hi Clement,
when you use upticks/downticks instructions, you have to ensure, that you have set Build Volume On is set to Tick Count (Format Instruments - Settings).
UpTicks counts only ticks, which are higher then the preceding.
DownTicks counts only ticks, which are lower then the preceding.

Regarding your code. I think the problem is following:
UpTick = close > close[ 1 ];
DownTick = close < close[ 1 ];
You compare the close of the previous bar with the current tick. The previous bars close does not change...
You need to store the previous tick in a separate variable and compare it then against the current tick.
A similar problem is with
UpTickCount = upTickCount[ 1 ] + 1;
You add 1 to the value of the previous bar. You have to remove the [1]!

Reply With Quote
The following user says Thank You to Squib for this post:

Old January 13th, 2012, 01:14 AM   #4 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 45,428 since Jun 2009
Thanks: 28,836 given, 79,544 received

If you search for MultiCharts Cumulative Delta you'll find this has been explored in detail.


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote


futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming > UpTick/Downtick Calculations

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Corey Rosenbloom: Tips, Tactics, and Real Trades: Trading Intraday Trend Reversals

Elite only

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
Bring Back the Uptick Rule! kbit News and Current Events 0 August 30th, 2011 10:45 PM
MultiCharts and IQFeed vs TradeStation for UpTick/DownTick data SPTrading MultiCharts 13 June 22nd, 2011 01:35 AM
Pivot Point calculations trendisyourfriend Investor/RT 11 May 2nd, 2011 06:50 PM
Slippage Calculations for Optimization benharrell Traders Hideout 7 December 20th, 2010 03:53 AM
OHLC calculations indicator vast NinjaTrader Programming 3 January 16th, 2010 05:43 AM

All times are GMT -4. The time now is 05:23 AM.

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