Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

cunparis

Pace of Tape - Measure Trade Intensity to Detect Reversals

Recommended Posts

I'd like to share something I've been working on. I'm using trade intensity to detect buying/selling exhaustion which often leads to reversals. The reversal can be a pause, a small pullback, or a full reversal. So this isn't something one can use mechanically but rather as an input into a discretionary trading method.

 

I measure trade intensity by the amount of trades occuring in a given time. This is equivalent to watching the time & sales for periods when the trades start scrolling really fast. I find that with this indicator I no longer have to watch time & sales.

 

I'd like to get some feedback on this idea and improve it. So far I have it available for Ninjatrader & Multicharts and you can look at the source code and program it for other platforms. If you do please send me a copy so that I can make it available on my blog and make it available to everyone else.

 

I'm attaching a chart showing a bit of how I use it. I have also created a blog page and a video which explains it in more detail.

 

http://www.tradewiththeflow.com/201...tape-indicator/

 

Thanks for looking, I hope you find it useful. And good trading to everyone!

5aa71007283a5_paceoftape-tradeintensityexampleonfesx20100517.thumb.png.c9137a3b0725fca86514dfd322f8c4eb.png

PaceOfTape NT65 v1.0.4.zipFetching info...

Share this post


Link to post
Share on other sites
  hunter1 said:
here it is in mc. could not get it to compile in TS perhaps someone could help with that?

 

not everyone has a crystal ball

you have to post the error message if you expect someone to help

Share this post


Link to post
Share on other sites
  hunter1 said:
here it is in mc. could not get it to verify in TS perhaps someone could help with that? the term " time_s " was not recognized.

 

I don't believe it will work in TS, or at least I don't believe it will be accurate, because TS only has 1 second resolution on the bars.

 

Thanks for the MC binary file.

Share this post


Link to post
Share on other sites
  hunter1 said:
here it is in mc. could not get it to verify in TS perhaps someone could help with that? the term " time_s " was not recognized.

 

that's a MultiCharts exclusive keyword.

Share this post


Link to post
Share on other sites
  cunparis said:
I don't believe it will work in TS, or at least I don't believe it will be accurate, because TS only has 1 second resolution on the bars.

 

.

 

... gotta scoot...quick idea...implement with ELTic and ELToc dll's in TS?

Share this post


Link to post
Share on other sites
  zdo said:
... gotta scoot...quick idea...implement with ELTic and ELToc dll's in TS?

 

Can you point me in the right direction? googling a couple of obvious permutations returned nothing.

Share this post


Link to post
Share on other sites
  Tams said:
that's a MultiCharts exclusive keyword.

 

Yeah... sorry TS users. I wrote it for 'time_s' on MC because cunparis was using it on fast charts and monitoring 30-seconds or less intervals. If you want to use it on a long-enough basis that you want to see the pace of the last few minutes, then you can re-write it for plain 'time' and adjust the 240000 constant and all should be well.

Share this post


Link to post
Share on other sites
  Dinerotrader said:
I am total inexperienced related to coding. What would I need to do try to get this indicator in EL so I could use it in OEC?

 

The multicharts version should be in easylanguage and should work, with the exception of the time_s which may not work.

 

Make sure OEC supports timestamps finer grained than 1 minute (like tradestation) or it will be less accurate.

Share this post


Link to post
Share on other sites

Thanks sadly I no longer have access to the TS forums :( if there are release notes with the .DLL's perhaps someone might cross post them. (Presuming they are public domain rather than for sale).

Share this post


Link to post
Share on other sites

The workspace will show you how it works but here's the text:

 

  Quote

Cy,

 

 

Here's a TradeStation-compatible DLL that provides microsecond Tic and Toc functions.

 

Additionally, the attached DLL code demonstrates the use of the IEasyLanguageProperties interface that is available as part of the EasyLanguage Extension Software Development Kit (SDK) (tskit.dll).

 

When called from EasyLanguage, the demonstration DLL creates (starts) or returns the elapsed time of user-named microsecond timers. Two DLL functions are provided:

 

ELTic( "TimerName" ) - Used to create and start a timer with a user selected name.

 

ELToc( "TimerName" ) - Used to return the number of microseconds (millionths of a second) that have elapsed since ELTic was called for the named timer.

 

 

 

 

The following files are contained in the attached zip file:

 

EasyLanguage Tic Toc Demo.tsw - Demonstration TradeStation workspace.

 

ELTicToc.dll - Compiled TradeStation-compatible DLL.

 

Tic Toc Demo Indicator.ELD - ELD file containing the Tic Toc Demo indicator, ready for importation into TradeStation.

 

ELTicToc.sln, ELTicToc.vcproj, ELTicTocDef.def, ELTicTocMain.cpp - Together, these files comprise the Visual C++ project from which the DLL is created.

 

 

Attachment: EasyLanguage Tic Toc Demo.zip 16 kB

 

 

 

 

Running the Demo

 

Running the demonstration is a five step process:

 

1.) Download the file EasyLanguage Tic Toc Demo.zip, posted above, to your computer.

 

2.) Extract the compiled DLL contained in the zip file, ELTicToc.dll, to your installation's equivalent to the following subdirectory:

 

C:\WINDOWS\system32\

 

 

3.) Double-click the .ELD file, and import the indicator contained therein.

 

4.) Move the TradeStation workspace file, EasyLanguage Tic Toc Demo.tsw, into your \Program Files\TradeStation\MyWork\ subdirectory.

 

5.) Open the demonstration workspace during a time when live market data is flowing and ensure that the DLL-calculated performance times for a section of the demonstration code plot on the chart after 10 "real-time" ticks have passed.

 

The demonstration code waits until 10 "real-time" ticks have passed. It then uses the microsecond performance timer to measure the time it takes to run a simple EasyLanguage code loop 1,000 times. The time it takes to perform this task is plotted on the chart. (Plotted times are in microseconds (millionths of a second). To convert to seconds, divide by 1,000,000.)

 

 

 

 

How it Works

 

Most modern PC's are equipped with a high-speed counter the count and frequency of which are both programmatically accessible. (This high speed counter is separate from the computer's time-of-day clock.) This high-speed counter can be used as a timer.

 

The DLL provides two functions, ELTic and ELToc, that can be called from EasyLanguage.

 

ELTic records the current performance counter count. This count is stored using the IEasyLanguageProperties interface of the calling EasyLanguage analysis technigue. This process can be thought of as the process of "creating" a timer of a name of your choice.

 

ELToc determines the current performance counter value. It then subtracts the starting performance counter value for the named timer, the value established when ELTic was called for the timer, and returns the difference between the two, in microseconds.

 

Thus, to measure any time period is a two-step process. First, when it is desired to "start the timer", ELTic is called with a given timer name of your choice. Then, when it is desired to "stop the timer", ELToc is called with the same timer name as a parameter.

 

Multiple timers may be used in a given piece of code.

 

Timers may be nested, like this:

 

 

ELTic( "Timer1" ) ;

 

{ Code block 1... }

 

ELTic( "Timer2" ) ;

 

{ Code block 2... }

 

ELToc( "Timer2" ) ;

 

{ Code block 3... }

 

ELToc( "Timer1" ) ;

 

Of course, if nested timers are used, measured times will include both the time for code to run and the time required to call timer functions. For example, in the above pseudocode, Timer1 would measure not only the time it takes to run code blocks 1, 2, and 3, but also the time it takes to make the ELTic and ELToc calls for Timer2.

 

Measured times may not exceed 2 billion microseconds (2,000 seconds, about 33 minutes). Attempts to time events that exceed this duration will result in a return value of -1 from the call to ELToc.

 

A runtime error will be generated in TradeStation if the DLL is unable to determine the frequency of the PC's performance counter.

 

A runtime error will be generated in TradeStation if an attempt is made to read a timer that does not exist. This would occur, for example, if ELToc were called with a specific timer name before ELTic had been called with that timer name.

 

20060720153912EasyLanguage Tic Toc Demo.zipFetching info...

Share this post


Link to post
Share on other sites

Ok, well I got it to compile in OEC...

 

inputs: period(30), threshold(600), normcolor(blue), highcolor(red);

vars:
 int pace(0),
 int indx(0);



pace = 0;
indx = 0; 
while(indx < CurrentBar) begin
 value1 = time - time[indx];
 if(value1 < 0) then value1 = time + 240000 - time[indx];
 if(value1 < period) then pace = pace + barinterval
 else break;
 indx = indx + 1; 
end;

//plot1(pace,"pace",iff(pace > threshold,highcolor,normcolor));
if pace > threshold then Plot2(pace,"Pace",green) 
   else Plot2(pace,"Pace",darkgray);

 

OEC didn't like the plot language so I switched it up. But I guess we need to adjust for the 240000 constant, because as far as I can tell this thing just resets on the hour...

 

What does the 240000 represent?

 

Heres how it looks right now:

attachment.php?attachmentid=21110&stc=1&d=1274453152

1.thumb.png.229143ea375a035aea51861a4fb6cce1.png

Share this post


Link to post
Share on other sites

Here's a similar approach for TS, I found a time ago.Maybe it can help.Measuring the "speed" of contracts is very interesting , but as we know TS is frome last century , unfortunately.

Here you go :

 

[LegacyColorValue = true];

 

DefineDLLFunc: "GetMachineTime.DLL",Long,"GetMachineTime";

 

Inputs: OutputType(1), {Input 1 for Minutes and fractions of minutes ( 1.50 stands for 1 minute 30 seconds )}

{Input 2 for output in minutes and seconds ( 1.50 stands for 1 minute 50 seconds)}

CapMinutes(20),

RealTimePlotClr(white), {Color of histogram plot from the time it was applied and calculating in seconds in real time )}

NonRTPlotClr(Darkgray), {Color of histogram plot before the time it was applied not calculating seconds in real time but rounded minutes )}

OverCapClr(darkred);

 

Vars: TxtID (0);

 

Array: myTimes[2](0);

 

 

If LastBarO

[code]

[/code]nChart then

begin

myTimes[1] = myTimes[0];

myTimes[0] = GetMachineTime;

Value1 = myTimes[0] * .01;

Value2 = IntPortion(Value1);

Value3 = Value1 - Value2;

Value4 = myTimes[1] * .01;

Value5 = IntPortion(Value4);

Value6 = Value4 - Value5;

Value7 = (Value3 - Value6) * 100;

 

If myTimes[1] = 0 and myTimes[0] <> 0 then

Value8 = TimeToMinutes(time) - TimeToMinutes(time)[1];

 

If myTimes[1] <> 0 and myTimes[0] <> 0 then

begin

If myTimes[1] > myTimes[0] then

Value8 = TimeToMinutes(Value2) - TimeToMinutes(Value5) + 1440

else

Value8 = TimeToMinutes(Value2) - TimeToMinutes(Value5);

end;

 

 

If OutputType = 1 then

Value9 = ((Value8 * 60) + Value7) / 60

else

Value9 = 0;

 

{

Print("TradeStation reserved word CurrentTime XYZ",CurrentTime:4:0,

NewLine,"Current Machine Time XYZ",Spaces(17),GetMachineTime:7:0," ",

(TimeToMinutes(Value2) - TimeToMinutes(Value5) + 1440));

 

Print(Value1," ", Value2," ", Value3," ", Value4," ", Value5," ", Value6," ", Value7," ", Value8," ", Value9);

Print(myTimes[0]," ", mytimes[1]);

}

 

end else

begin

If Time[1] <= 2359 and Time >= 0 and Time < Time[1] then

value9 = TimeToMinutes(Time) - TimeToMinutes(Time)[1] + 1440

else

value9 = TimeToMinutes(Time) - TimeToMinutes(Time)[1];

end;

 

If Ticks <> 0 then

Value10 = Value9 / Ticks;

 

If Value9 > CapMinutes then

Value9 = CapMinutes;

 

Plot1(Value10, "Vol/sec");

 

If myTimes[1] = 0 then

SetPlotColor(1, NonRTPlotClr)

else

SetPlotColor(1, RealTimePlotClr);

 

If Value9 = CapMinutes then

SetPlotColor(1, OverCapClr);

 

 

 

regs

_GetMachineTime.zipFetching info...

Share this post


Link to post
Share on other sites
  jojojo said:
Here's a similar approach for TS, I found a time ago.Maybe it can help.Measuring the "speed" of contracts is very interesting , but as we know TS is frome last century , unfortunately.

 

Thats the same one I linked a couple of posts ago. :) You can find a couple of charts I posted in the original trade intensity thread using this code. I actually rather like the indications it gives (small bars represent intense trade).

 

Always thought intensity needs some sort of smoothing (which again was discussed before) it can go from very close to zero to pretty darn massive in one tick.

 

It would be pretty trivial to convert to intensity. Isn't time taken pretty close to the reciprocal of intensity any way? Too early to think about for now:)

Share this post


Link to post
Share on other sites

I missed this "intensity"thread , and worked through it a few hours ; )

interesting , how often people got the same ideas at the same time (sometimes)

anyhow ,I think I tried to convert this to intensity in the past but did not suceed and left it.I believe I gave up on this "tick-based" chart construction thing instead of "time based" in TS.

Maybe you can post a link to your charts, I could not find them.

regs

Jojo

Share this post


Link to post
Share on other sites

Hi guys,

 

I have found an MC version of the Pace of tape indicators.

Unfortunately, code is not working for TS, unknow words for "time_s"

i have tried to fix it without success, any help on it will be appreciate it

 

See text and links below:

 

inputs: period(30), threshold(600), normcolor(blue), highcolor(red);

 

vars:

int pace(0),

int indx(0);

 

 

 

pace = 0;

indx = 0;

while(indx < CurrentBar) begin

value1 = time_s - time_s[indx];

if(value1 < 0) then value1 = time_s + 240000 - time_s[indx];

if(value1 < period) then pace = pace + barinterval

else break;

indx = indx + 1;

end;

 

plot1(pace,"pace",iff(pace > threshold,highcolor,normcolor));

 

link:http://www.tradewiththeflow.com/wp-content/uploads/2010/05/PaceOfTape-MC-Source.txt

 

Cheers,

Larry

Share this post


Link to post
Share on other sites
  LARRY2117 said:
Hi guys,

 

I have found an MC version of the Pace of tape indicators.

Unfortunately, code is not working for TS, unknow words for "time_s"

i have tried to fix it without success, any help on it will be appreciate it

 

See text and links below:

...Larry

 

forget it...

 

TIME_S is an EasyLanguage extension created by MultiCharts'

 

TradeStation does not do sub-minute analysis.

You have to get the DLL posted here in one of the posts.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • My wife Robin just wanted some groceries.   Simple enough.   She parked the car for fifteen minutes, and returned to find a huge scratch on the side.   Someone keyed her car.   To be clear, this isn’t just any car.   It’s a Cybertruck—Elon Musk's stainless-steel spaceship on wheels. She bought it back in 2021, before Musk became everyone's favorite villain or savior.   Someone saw it parked in a grocery lot and felt compelled to carve their hatred directly into the metal.   That's what happens when you stand out.   Nobody keys a beige minivan.   When you're polarizing, you're impossible to ignore. But the irony is: the more attention something has, the harder it is to find the truth about it.   What’s Elon Musk really thinking? What are his plans? What will happen with DOGE? Is he deserving of all of this adoration and hate? Hard to say.   Ideas work the same way.   Take tariffs, for example.   Tariffs have become the Cybertrucks of economic policy. People either love them or hate them. Even if they don’t understand what they are and how they work. (Most don’t.)   That’s why, in my latest podcast (link below), I wanted to explore the “in-between” truth about tariffs.   And like Cybertrucks, I guess my thoughts on tariffs are polarizing.   Greg Gutfield mentioned me on Fox News. Harvard professors hate me now. (I wonder if they also key Cybertrucks?)   But before I show you what I think about tariffs… I have to mention something.   We’re Headed to Austin, Texas This weekend, my team and I are headed to Austin. By now, you should probably know why.   Yes, SXSW is happening. But my team and I are doing something I think is even better.   We’re putting on a FREE event on “Tech’s Turning Point.”   AI, quantum, biotech, crypto, and more—it’s all on the table.   Just now, we posted a special webpage with the agenda.   Click here to check it out and add it to your calendar.   The Truth About Tariffs People love to panic about tariffs causing inflation.   They wave around the ghost of the Smoot-Hawley Tariff from the Great Depression like it’s Exhibit A proving tariffs equal economic collapse.   But let me pop this myth:   Tariffs don’t cause inflation. And no, I'm not crazy (despite what angry professors from Harvard or Stanford might tweet at me).   Here's the deal.   Inflation isn’t when just a couple of things become pricier. It’s when your entire shopping basket—eggs, shirts, Netflix subscriptions, bananas, everything—starts costing more because your money’s worth less.   Inflation means your dollars aren’t stretching as far as they used to.   Take the 1800s.   For nearly a century, 97% of America’s revenue came from tariffs. Income tax? Didn’t exist. And guess what inflation was? Basically zero. Maybe 1% a year.   The economy was booming, and tariffs funded nearly everything. So, why do people suddenly think tariffs cause inflation today?   Tariffs are taxes on imports, yes, but prices are set by supply and demand—not tariffs.   Let me give you a simple example.   Imagine fancy potato chips from Canada cost $10, and a 20% tariff pushes that to $12. Everyone panics—prices rose! Inflation!   Nope.   If I only have $100 to spend and the price of my favorite chips goes up, I either stop buying chips or I buy, say, fewer newspapers.   If everyone stops buying newspapers because they’re overspending on chips, newspapers lower their prices or go out of business.   Overall spending stays the same, and inflation doesn’t budge.   Three quick scenarios:   We buy pricier chips, but fewer other things: Inflation unchanged. Manufacturers shift to the U.S. to avoid tariffs: Inflation unchanged (and more jobs here). We stop buying fancy chips: Prices drop again. Inflation? Still unchanged. The only thing that actually causes inflation is printing money.   Between 2020 and 2022 alone, 40% of all money ever created in history appeared overnight.   That’s why inflation shot up afterward—not because of tariffs.   Back to tariffs today.   Still No Inflation Unlike the infamous Smoot-Hawley blanket tariff (imagine Oprah handing out tariffs: "You get a tariff, and you get a tariff!"), today's tariffs are strategic.   Trump slapped tariffs on chips from Taiwan because we shouldn’t rely on a single foreign supplier for vital tech components—especially if that supplier might get invaded.   Now Taiwan Semiconductor is investing $100 billion in American manufacturing.   Strategic win, no inflation.   Then there’s Canada and Mexico—our friendly neighbors with weirdly huge tariffs on things like milk and butter (299% tariff on butter—really, Canada?).   Trump’s not blanketing everything with tariffs; he’s pressuring trade partners to lower theirs.   If they do, everybody wins. If they don’t, well, then we have a strategic trade chess game—but still no inflation.   In short, tariffs are about strategy, security, and fairness—not inflation.   Yes, blanket tariffs from the Great Depression era were dumb. Obviously. Today's targeted tariffs? Smart.   Listen to the whole podcast to hear why I think this.   And by the way, if you see a Cybertruck, don’t key it. Robin doesn’t care about your politics; she just likes her weird truck.   Maybe read a good book, relax, and leave cars alone.   (And yes, nobody keys Volkswagens, even though they were basically created by Hitler. Strange world we live in.) Source: https://altucherconfidential.com/posts/the-truth-about-tariffs-busting-the-inflation-myth    Profits from free accurate cryptos signals: https://www.predictmag.com/       
    • No, not if you are comparing apples to apples. What we call “poor” is obviously a pretty high bar but if you’re talking about like a total homeless shambling skexie in like San Fran then, no. The U.S.A. in not particularly kind to you. It is not an abuse so much as it is a sad relatively minor consequence of our optimism and industriousness.   What you consider rich changes with circumstances obviously. If you are genuinely poor in the U.S.A., you experience a quirky hodgepodge of unhelpful and/or abstract extreme lavishnesses while also being alienated from your social support network. It’s about the same as being a refugee. For a fraction of the ‘kindness’ available to you in non bio-available form, you could have simply stayed closer to your people and been MUCH better off.   It’s just a quirk of how we run the place and our values; we are more worried about interfering with people’s liberty and natural inclination to do for themselves than we are about no bums left behind. It is a slightly hurtful position and we know it; we are just scared to death of socialism cancer and we’re willing to put our money where our mouth is.   So, if you’re a bum; you got 5G, the ER will spend like $1,000,000 on you over a hangnail but then kick you out as soon as you’re “stabilized”, the logistics are surpremely efficient, you have total unchecked freedom of speech, real-estate, motels, and jobs are all natural healthy markets in perfect competition, you got compulsory three ‘R’’s, your military owns the sky, sea, space, night, information-space, and has the best hairdos, you can fill out paper and get all the stuff up to and including a Ph.D. Pretty much everything a very generous, eager, flawless go-getter with five minutes to spare would think you might need.   It’s worse. Our whole society is competitive and we do NOT value or make any kumbaya exception. The last kumbaya types we had werr the Shakers and they literally went extinct. Pueblo peoples are still around but they kind of don’t count since they were here before us. So basically, if you’re poor in the U.S.A., you are automatically a loser and a deadbeat too. You will be treated as such by anybody not specifically either paid to deal with you or shysters selling bejesus, Amway, and drugs. Plus, it ain’t safe out there. Not everybody uses muhfreedoms to lift their truck, people be thugging and bums are very vulnerable here. The history of a large mobile workforce means nobody has a village to go home to. Source: https://askdaddy.quora.com/Are-the-poor-people-in-the-United-States-the-richest-poor-people-in-the-world-6   Profits from free accurate cryptos signals: https://www.predictmag.com/ 
    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.