Hi,
I'm looking for an indicator that would plot in a histogram, the length of time that the current tick bar took to complete. Does anyone have something like that to share or can someone share a link?
Thanks.
Tick Speed / Bar Speed [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Tick Speed / Bar Speed
Hi,
I'm looking for an indicator that would plot in a histogram, the length of time that the current tick bar took to complete. Does anyone have something like that to share or can someone share a link?
Thanks.
try:
Time_s minus Time_s[1]
Re: Tick Speed / Bar Speed
This is what I have so far but it's not working when the minute changes and the current bar has a seconds value that is lower than the previous [1] bar, even if the minute value is greater.
Code: Select all
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (time_s - time_s[1]);
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
- Attachments
-
- No value.png
- (53.52 KiB) Downloaded 1289 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Tick Speed / Bar Speed
When you copy codes from the internet,This is what I have so far but it's not working when the minute changes and the current bar has a seconds value that is lower than the previous [1] bar, even if the minute value is greater.
Code: Select all
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (time_s - time_s[1]);
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
you should paste the complete code.
Why did you edit out the pertinent parts of the code?
Without disclosing what you have done,
you are just sending people off on a wild goose chase.
Also, you should not delete the header, because that's part of the code.
Re: Tick Speed / Bar Speed
I didn't know that comments were pertinent.When you copy codes from the internet,This is what I have so far but it's not working when the minute changes and the current bar has a seconds value that is lower than the previous [1] bar, even if the minute value is greater.
Code: Select all
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (time_s - time_s[1]);
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
you should paste the complete code.
Why did you edit out the pertinent parts of the code?
You are just sending people off on a wild goose chase.
Also, you should not delete the header, because that's part of the code.
Code: Select all
// Tick Speedo
//
// This indicator measures the time it takes to complete a tick or volume bar
// a Short bar denotes an active market.
// when the market is slow, it will take a long time to complete the bar.
// a cap is used to limit the height of the histogram during slow times
//
// pls post your comments and enhancement here:
// http://www.elitetrader.com/vb/showthread.php?s=&threadid=146049&perpage=40&pagenumber=1
//
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (time_s - time_s[1]);
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Tick Speed / Bar Speed
I didn't know that comments were pertinent.
Help is appreciated.Code: Select all
// Tick Speedo
//
// This indicator measures the time it takes to complete a tick or volume bar
// a Short bar denotes an active market.
// when the market is slow, it will take a long time to complete the bar.
// a cap is used to limit the height of the histogram during slow times
//
// pls post your comments and enhancement here:
// http://www.elitetrader.com/vb/showthread.php?s=&threadid=146049&perpage=40&pagenumber=1
//
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (time_s - time_s[1]);
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
Where did you get this code?
Re: Tick Speed / Bar Speed
From the EliteTrader forum. Why does it matter where it came from? I have a full lifetime licence for MultiCharts and I came to this forum for help.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Tick Speed / Bar Speed
Because that's not the code as posted in EliteTrader.From the EliteTrader forum. Why does it matter where it came from? I have a full lifetime licence for MultiCharts and I came to this forum for help.
You butchered it. That's why it does not work.
Re: Tick Speed / Bar Speed
The code as it came from EliteTrader did not work for me. TimeToMinutes or TimeToSeconds did not plot correctly for me that's why I came here asking for help.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Tick Speed / Bar Speed
Then you should have stated your problem up front in the very beginning,The code as it came from EliteTrader did not work for me. TimeToMinutes or TimeToSeconds did not plot correctly for me that's why I came here asking for help.
and let people know that you have edited the code,
so that people do not waste time chasing down a perceived problem.
Re: Tick Speed / Bar Speed
This is the code I started with:
It did not work. I changed the TimeToMinutes to TimeToSeconds and it did not work. Then I changed the code to this:
This is much closer to working except for when the minute changes and the current bar has a seconds value that is lower than the previous [1] bar, even if the minute value is greater.
Code: Select all
// Tick Speedo
//
// This indicator measures the time it takes to complete a tick or volume bar
// a Short bar denotes an active market.
// when the market is slow, it will take a long time to complete the bar.
// a cap is used to limit the height of the histogram during slow times
//
// pls post your comments and enhancement here:
// http://www.elitetrader.com/vb/showthread.php?s=&threadid=146049&perpage=40&pagenumber=1
//
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (TimeToMinutes(time)-TimeToMinutes(time[1]));
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
Code: Select all
// Tick Speedo
//
// This indicator measures the time it takes to complete a tick or volume bar
// a Short bar denotes an active market.
// when the market is slow, it will take a long time to complete the bar.
// a cap is used to limit the height of the histogram during slow times
//
// pls post your comments and enhancement here:
// http://www.elitetrader.com/vb/showthread.php?s=&threadid=146049&perpage=40&pagenumber=1
//
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (time_s - time_s[1]);
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Tick Speed / Bar Speed
When you say "It did not work",
you have to describe what did not work.
No plot?
wrong color?
wrong type?
plotted wrong? how?
screen shots?
what is the instrument?
what is the chart interval?
what do you mean by wrong? wrong scale? wrong interval? wrong size?
how often is the "wrong"? all the time? intermittently wrong?
where did it go wrong? all the symbols or just one?
Is it "wrong" with all the chart intervals? or just one type?
when did it go wrong? in real time? off-line? during backtest?
You have to think through your problem.
Simply saying "It did not work" will not get you to the solution you desired.
You have to describe what did not work for you.
Simply saying "It did not work" will not turn a good code into bad code.
Butchering the code does not help.
You should begin this problem-solving process with your implementation, not with the code.
you have to describe what did not work.
No plot?
wrong color?
wrong type?
plotted wrong? how?
screen shots?
what is the instrument?
what is the chart interval?
what do you mean by wrong? wrong scale? wrong interval? wrong size?
how often is the "wrong"? all the time? intermittently wrong?
where did it go wrong? all the symbols or just one?
Is it "wrong" with all the chart intervals? or just one type?
when did it go wrong? in real time? off-line? during backtest?
You have to think through your problem.
Simply saying "It did not work" will not get you to the solution you desired.
You have to describe what did not work for you.
Simply saying "It did not work" will not turn a good code into bad code.
Butchering the code does not help.
You should begin this problem-solving process with your implementation, not with the code.
Re: Tick Speed / Bar Speed [SOLVED]
Thanks for your help. I figured it out. This gives me want I want.
Code: Select all
// Tick Speedo
//
// This indicator measures the time it takes to complete a tick or volume bar
// a Short bar denotes an active market.
// when the market is slow, it will take a long time to complete the bar.
// a cap is used to limit the height of the histogram during slow times
//
// pls post your comments and enhancement here:
// http://www.elitetrader.com/vb/showthread.php?s=&threadid=146049&perpage=40&pagenumber=1
//
input:
cap(15),
cap.color(darkgray);
if BarType = 0 then
begin
if date = date[1] then
begin
value1 = (TimeToSeconds(time_s)-TimeToSeconds(time_s[1]));
if value1 <= cap then
plot1(value1, "tick time")
else
plot2(cap,"Cap", cap.color);
end;
end;
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Tick Speed / Bar Speed
This is a community,Thanks for your help. I figured it out. This gives me want I want.
you should share the error that caused the problem
and how this code solved the problem.
This is how we learn from each others.
Re: Tick Speed / Bar Speed
My issue was that I wanted to get a bar speed with a resolution in seconds. The TimeToMinutes only gave minute resolution as does the Time reserved word. I needed to get both of those to seconds resolution. TimeToSeconds obviously does that but then I needed to change the Time to Time_s which is seconds. That solved my issue.