Jump to content
Medved Trader Forums

Obtaining Current System Time within a Renko Bar

Doug Hayman

Recommended Posts

I was wondering if this can somehow be accomplished in C# Advanced Paintbars:

A couple of preliminary items:

1) I am using Renko Bars (4 points) for futures;

2) I am doing this as part of my back testing  efforts;

Renko bars get timestamped (TimeStamp) when the Renko bar is created.  In my back testing logic, I want to close any simulated trade, say within 15 minutes of market close.

So, as an example, let's say a trade fires off, and my last Renko Bar has a TimeStamp of 15:24:25.  16:00:00 comes around (15 minutes of market close), and I'm still in that same Renko bar.   I cannot check the TimeStamp of the Renko Bar to see if we're at 4:00 PM, since the TimeStamp associated with that bar is 15:24:25.  I tried creating a variable of type "DateTime CurTime", but I get the following error on declaration, "96, 16    CS0103    Possible security violation".   Not sure that would have given me the desired result anyway, as it might provide current system time (that is, the time when I run the back test), as opposed to the current time with the Bar.

Is there any way that I can check the system time, while within the Renko Bar, via logic?  

Thank you in advance.


Link to comment
Share on other sites

Mike, for Renko bars "Timestamp" refers to the creation date/time of the bar.  Is there a way to access the END date/time of the Renko bar?  I don't see anything in the doc that would gain me access to that.   And yes, that would solve my issue.

For regular time-based bars, END date/time could obviously be easily derived.  For Renko's I cannot derive, since we don't have bar look-ahead capabilities (for back-testing purposes, that is).

Link to comment
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.

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.


  • Create New...