[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tick-min indicator question



PureBytes Links

Trading Reference Links

Off the top of my head, how about:  FuncX(Sess1EndTime) - FuncX(Sess1StartTime)

That should work as long as the session starts and ends during the same day.

The problem is that the times above are based on 60-minute hours, so, for
example a NYSE stock will yield 1600 - 930, and the subtraction (omitting FuncX)
will go awry (1600 - 930 = 870, which is clearly wrong due to only having 60
minutes/hr).

Some years ago, I successfully coded for FunctionX, so I know it can be done,
but I have long since forgotten it.  What I recall is that I broke, eg,
Sess1EndTime, down into hours and minutes (ie, 16 hours + 0 minutes = 16 * 60
minutes + 0 minutes = 960 minutes), then converted the hours and minutes into
total number of minutes --- did the same for Sess1StartTime (ie, 9 hours + 30
minutes = 9 * 60 minutes + 30 minutes = 540 minutes + 30 minutes = 570 minutes),
and then subtracted the two from each other (960 - 570 = 390 minutes), getting
the difference in total number of minutes for the session, as you are looking
for.  There is the rationale, and I'll leave the coding to you.  You'll need to
find the ELA function(s) that separates numbers into component parts based on
place holding.  As I recall I used the IntegerPortion and Fractional Portion
functions with various parameters, eg, IntPortion(Sess1StartTime/100) = 9 and
FracPortion(Sess1StartTime/100) = 0.30.  So, how about, for converting time in
total number of minutes IntPortion(Sess1StartTime/100) * 60 +
FracPortion(Sess1StartTime/100) * 100.  Does that work?  If so, then:

Total Session Time in minutes = ( IntPortion(Sess1EndTime/100) * 60 +
FracPortion(Sess1EndTime/100) * 100 ) -
( IntPortion(Sess1StartTime/100) * 60 + FracPortion(Sess1StartTime/100) * 100 )

Bob Fulks & Co. (and many others here) are far more sophisticated coders than
I.  Perhaps they could help you.  Maybe there is even an ELA function that gives
the solution far simpler than the above, which may give you some ideas to get
you started towards your goal.



Brent wrote:

> Is there an easy language function, or a way to derive the amount, that
> refers to the total number of minutes in the day session for each individual
> security. I need to have only the end total at the end of the day session,
> not a running total. An example of the amount is, 405 minuets in the day
> session for the S&P 500, 400 minutes for the bonds and currencies, 390
> minutes for the Dow Jones Industrials etc.
>
> Thanks
>
> Brent