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.zip

Share this post


Link to post
Share on other sites
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
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
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
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
... 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
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
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:

 

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.zip

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.zip

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.

 

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
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

    • Date: 22nd November 2024.   BTC flirts with $100K, Stocks higher, Eurozone PMI signals recession risk.   Asia & European Sessions:   Geopolitical risks are back in the spotlight on fears of escalation in the Ukraine-Russia after Russia reportedly used a new ICBM to retaliate against Ukraine’s use of US and UK made missiles to attack inside Russia. The markets continue to assess the election results as President-elect Trump fills in his cabinet choices, with the key Treasury Secretary spot still open. The Fed’s rate path continues to be debated with a -25 bp December cut seen as 50-50. Earnings season is coming to an end after mixed reports, though AI remains a major driver. Profit taking and rebalancing into year-end are adding to gyrations too. Wall Street rallied, led by the Dow’s 1.06% broadbased pop. The S&P500 advanced 0.53% and the NASDAQ inched up 0.03%. Asian stocks rose after  Nvidia’s rally. Nikkei added 1% to 38,415.32 after the Tokyo inflation data slowed to 2.3% in October from 2.5% in the prior month, reaching its lowest level since January. The rally was also supported by chip-related stocks tracked Nvidia. Overnight-indexed swaps indicate that it’s certain the Reserve Bank of New Zealand will cut its policy rate by 50 basis points on Nov. 27, with a 22% chance of a 75 basis points reduction. European stocks futures climbed even though German Q3 GDP growth revised down to 0.1% q/q from the 0.2% q/q reported initially. Cryptocurrency market has gained approximately $1 trillion since Trump’s victory in the Nov. 5 election. Recent announcement for the SEC boosted cryptos. Chair Gary Gensler will step down on January 20, the day Trump is set to be inaugurated. Gensler has pushed for more protections for crypto investors. MicroStrategy Inc.’s plans to accelerate purchases of the token, and the debut of options on US Bitcoin ETFs also support this rally. Trump’s transition team has begun discussions on the possibility of creating a new White House position focused on digital asset policy.     Financial Markets Performance: The US Dollar recovered overnight and closed at 107.00. Bitcoin currently at 99,300,  flirting with a run toward the 100,000 level. The EURUSD drifts below 1.05, the GBPUSD dips to June’s bottom at 1.2570, while USDJPY rebounded to 154.94. The AUDNZD spiked to 2-year highs amid speculation the RBNZ will cut the official cash rate by more than 50 bps next week. Oil surged 2.12% to $70.46. Gold spiked to 2,697 after escalation alerts between Russia and Ukraine. Heightened geopolitical tensions drove investors toward safe-haven assets. Gold has surged by 30% this year. Haven demand balanced out the pressure from a strong USD following mixed US labor data. Silver rose 0.9% to 31.38, while palladium increased by 0.9% to 1,040.85 per ounce. Platinum remained unchanged. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news. Andria Pichidi HFMarkets Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • A few trending stocks at support BAM MNKD RBBN at https://stockconsultant.com/?MNKD
    • BMBL Bumble stock watch, pull back to 7.94 support area with high trade quality at https://stockconsultant.com/?BMBL
    • LUMN Lumen Technologies stock watch, pull back to 7.43 support area with bullish indicators at https://stockconsultant.com/?LUMN
×
×
  • Create New...

Important Information

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