NexusFi: Find Your Edge


Home Menu

 





MillisecondsFromDateTime


Discussion in MultiCharts

Updated
    1. trending_up 2,483 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 13 posts
    2. attach_file 0 attachments




 
Search this Thread

MillisecondsFromDateTime

  #1 (permalink)
nivi
Madrid, Spain
 
Posts: 30 since Feb 2017
Thanks Given: 4
Thanks Received: 6

See this simply indicator:

 
Code
plot1(DateTime);
plot2(MillisecondsFromDateTime(DateTime));
Then, plot1 works correctly, I can see 43325.72

But plot2 show me always value 0.
I need to see exactly the milliseconds of the current bar.
Thanks.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Quant vue
Trading Reviews and Vendors
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Hi nivi,

what chart time frame do you apply the indicator to?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
nivi
Madrid, Spain
 
Posts: 30 since Feb 2017
Thanks Given: 4
Thanks Received: 6


timeframe = 1 minute
chart = future 6E

Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

nivi,

this explains why you only see 0 for the milliseconds, as you are asking for the ending time stamps of the bars.
Hover over the bars and check the exact time that MC displays. You will see that all end with 0 seconds and milliseconds.

Now apply your code to a tick chart and you should get different values or check
plot2(MillisecondsFromDateTime(ComputerDateTime)); on minute charts.

Regards,

ABCTG


nivi View Post
timeframe = 1 minute
chart = future 6E


Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
nivi
Madrid, Spain
 
Posts: 30 since Feb 2017
Thanks Given: 4
Thanks Received: 6

Yes! Thanks.

But I have another problem.

 
Code
[IntrabarOrderGeneration = true]

variables:
	t1(0),
	t2(0);

if close <> close[1] then begin
	t2 = t1;
	t1 = SecondsFromDateTime(ComputerDateTime) + MillisecondsFromDateTime(ComputerDateTime) / 1000;

	plot1(t1-t2);
end;
I need to see time frame = 1 minute.
And want a indicator that show the time of change from last close price to last close price.

For example:

18h:36m:12s:125mm, price is at level 2830
18h:36m:12s:525mm, price is at level 2830 (new tick at the same level, not relevant)
18h:36m:12s:725mm, price is at level 2831 (new tick at NEW level)

And then indicator shows: 0.600 (because .725-.125)

IntrabarOrderGeneration = true, to update in real time the value of indicator

But, "if close <> close[1]" it means a new close on 1 minute bar. And I need a new close (level) on the price.

Each new closing level then:
t2(last time) = t1
t1 = new time
...and then plot t1-t2

Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Hi nivi,

you are welcome. By the way you can show your appreciation for posts on futures.io by clicking the "Thanks" button next to a post.

You will require two variables for that on each code calculation store the value of the first variable in the second and then store the current close in the first variable. This way you can compare the value of the last two real time ticks.

Regards,

ABCTG


nivi View Post
Yes! Thanks.

But I have another problem.

 
Code
[IntrabarOrderGeneration = true]

variables:
	t1(0),
	t2(0);

if close <> close[1] then begin
	t2 = t1;
	t1 = SecondsFromDateTime(ComputerDateTime) + MillisecondsFromDateTime(ComputerDateTime) / 1000;

	plot1(t1-t2);
end;
I need to see time frame = 1 minute.
And want a indicator that show the time of change from last close price to last close price.

For example:

18h:36m:12s:125mm, price is at level 2830
18h:36m:12s:525mm, price is at level 2830 (new tick at the same level, not relevant)
18h:36m:12s:725mm, price is at level 2831 (new tick at NEW level)

And then indicator shows: 0.600 (because .725-.125)

IntrabarOrderGeneration = true, to update in real time the value of indicator

But, "if close <> close[1]" it means a new close on 1 minute bar. And I need a new close (level) on the price.

Each new closing level then:
t2(last time) = t1
t1 = new time
...and then plot t1-t2


Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
nivi
Madrid, Spain
 
Posts: 30 since Feb 2017
Thanks Given: 4
Thanks Received: 6

In my last post are all well explained.
The problem now is:

if close <> close[1] then begin

It works on a new close of 1 minute bar, and need to work on a new price level.

Reply With Quote
  #8 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Hi nivi,

I understand and I provided you one possible solution in the previous post.

Regards,

ABCTG


nivi View Post
In my last post are all well explained.
The problem now is:

if close <> close[1] then begin

It works on a new close of 1 minute bar, and need to work on a new price level.


Follow me on Twitter Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

One thing to keep in mind is that Multicharts won't perform intrabar computations on historical bars.

Regards,

ABCTG


nivi View Post
In my last post are all well explained.
The problem now is:

if close <> close[1] then begin

It works on a new close of 1 minute bar, and need to work on a new price level.


Follow me on Twitter Reply With Quote
  #10 (permalink)
nivi
Madrid, Spain
 
Posts: 30 since Feb 2017
Thanks Given: 4
Thanks Received: 6


Sorry but I dont understand
Historical bar is no problem, it works on real time.

You say: "You will require two variables for that on each code calculation store the value of the first variable in the second and then store the current close in the first variable. This way you can compare the value of the last two real time ticks."

That's not the problem. Look the code:
 
Code
	t2 = t1;
	t1 = SecondsFromDateTime(ComputerDateTime) + MillisecondsFromDateTime(ComputerDateTime) / 1000;
The problem is that this code must be executed every time a new level in the price occurs. Of course intrabar.

Reply With Quote




Last Updated on August 14, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts