NexusFi: Find Your Edge


Home Menu

 





Time of x ticks bar


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one TraderWalrus with 2 posts (0 thanks)
    2. looks_two ABCTG with 2 posts (3 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Cosmos110 with 1 posts (0 thanks)
    1. trending_up 3,626 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 5 posts
    2. attach_file 1 attachments




 
Search this Thread

Time of x ticks bar

  #1 (permalink)
TraderWalrus
Bangkok Thailand
 
Posts: 36 since May 2016
Thanks Given: 15
Thanks Received: 17

In case of using bars of 100 ticks each (for example) - how is it possible to find the time difference between the current and previous bar?

The Time() function only returns hours and minutes. Is there a way to get the time of the previous bar with an accuracy of seconds?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


TraderWalrus,

"Time_s" is time accurate to seconds, "DateTime" would even give you millisecond accuracy.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
TraderWalrus
Bangkok Thailand
 
Posts: 36 since May 2016
Thanks Given: 15
Thanks Received: 17

I tried to use time_s - time_s[1] to get the difference in seconds between the current and the previous bar, it works as long as both bars are in the same minute.

Any easy way to calculate this difference when the bars are in different minutes / hours? is it possible to convert the value returned by time_s to seconds since midnight for example?

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

TraderWalrus,

you can't just subtract these time values without running into the issue you describe - it would be the same for "Time - Time[1]". One approach is to use the TimeToSeconds function to convert the time to seconds (for both time values) and then build the difference between seconds.
Keep in mind that you might get negative times in case the previous bar is on the previous day, while the current bar is on the current day.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
Cosmos110
Coldspring, TX
 
Posts: 1 since Jul 2017
Thanks Given: 0
Thanks Received: 0

I use Ninja Trader and I crossed this problem before. I can't say I ever made any use out of it but maybe you can (and then give it back to me). I put a screen shot in an attachment. This is using an overlay on my chart and then changing one chart from "Time" to "Ticks" so that I have both of them on one chart for comparison. I wondered if one chart would show a pattern that the other one didn't but I never managed to use it on anything myself.
.................

Attached Thumbnails
Click image for larger version

Name:	2017-07-20_9-47-43.jpg
Views:	222
Size:	299.6 KB
ID:	238600  
Reply With Quote




Last Updated on July 21, 2017


© 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