Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am trying to draw the TOS TPOProfile indicator from a user input specific time - say 7am - using a tick chart. Obviously a tick derived bar may not start at exactly 7am. How do I achieve this?
I have created an input starttime = 0700; (for 7am) and then replaced the (0) in line 18 with starttime but I am still not drawing the profile from 7am or the bar that opens after 7am.
I have tried lots of other combinations and permutations (and crashed TOS !) but with no success.
I have been through the other indicators but cannot find an example to copy - if you know of any please point me in the right direction or point out where I am going wrong.
Thanks.
Can you help answer these questions from other members on NexusFi?
To the best of my knowledge this may be a little trick because of the way aggregation time is done on intra-day. You have to do some math in the script and divide 3600 for hour, 1800 for 30 min and so on. But that is with a time chart. I will have to check about the tick charts and secondary aggregation. If you need more help let me know
Hi thanks for taking a look - You are right regards the aggregation in TOS. I haven't spent much time on this yet this week.
I have been trying to convert code from my NT indy but it looks like I will have to create an imaginative work around in order to define the start bar for drawing the profile. This is easy using a timed based aggregation and is already a feature of the indy but getting it to draw a profile from the bar nearest to 7am or whatever the user inputs when using tick derived bars is proving a headache.
I have found a pivot indicator that uses an input to draw the lines 'from' and 'to' - I will test this with tick bars and see how it works - a bit long winded but it may be a work around.
I will keep posting and any other input gratefully received.
Ben.
Just to be clear I want to draw a profile say every 4 hours using the existing settings within the indy but I want to be able to specify that it starts the profile at say 6am using a tick derived bar - NOT the first bar of the session.
It may be a case of defining something like startbar = the nth bar after the start of the session that is closest to the users input time. In NT this is easy - if it's easy in TOS please let me know - I haven't engaged the cogs on this line of thought yet!
NT script below is from the DrawVerticalLine indy – you can also look at the dValue indy. In NT you can simply use
Bars.GetBar() or you can use BarsSinceSession()
The problem in TOS is identifying the bar that opens after the user input time (just to keep it simple) - if we wanted to get the closest open to the users input time we would have to compare open[0] and open[1] then plot ….. but the main problem is identifying the bar to start the plot from.
I will be able to do more on this at the weekend.
Ben.
protected override void OnBarUpdate()
{
if (CurrentBar < 1) { return; }
// Determine if this bar fits the time parameters and plot if so...
if (Time[0].TimeOfDay.CompareTo(timeToPlot) >= 0 && Time[1].TimeOfDay.CompareTo(timeToPlot) < 0)
{
this.DrawLine("VertTop" + CurrentBar.ToString(), false, Time[0], High[0] + (BarToLineOffsetInTicks * TickSize), Time[0],
High[0] + LineLengthInTicks*TickSize, LineColor, LineStyle, LineSize);
Think i have got to the bottom of this one - haven't solved it completely as I have been busy but the Volume profile has a StartNewProfile parameter. All one needs to do is define the start time and then plot the profile turns out to be quite simple i think. All you have to do is write the condition if open of current bar is > 7am(user input time) then profile myProfile = VolumeProfile(Symbol, PricePerRow.TickSize, myStartCondition, Not on expansion, #ofprofiles 6, Va=68%);
myProfile.Show(.....etc );
obviously I haven't tested this yet but will get round to it this week.