Gap Script

Optuma Forums Optuma Scripting Gap Script

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #70487
    Jonathan
    • Topics: 48
    • Replies: 68
    • Posts: 116

    I am trying to use either show bar or showplot to higligth two points.
    Using Axicorp –
    10pm which is 5pm NY and 4:30pm which is 9:30am NY.

    I can’t seem to get just those two points highlighted.

    // Find the full bar date with intraday decimals
    V1 = BARDATE();
    // Find the daily bar date, without decimals
    V2 = ROUND(V1 – 5/24, DECIMALTYPE=0);
    // Reduce bar date to intraday range only
    V3 = V1 – V2;
    // Identify time range between 9:59 pm on Friday and 4:35 am on Monday
    V4 = ((DAYOFWEEK() == 6) and (V3 >= -0.2291667)) or ((DAYOFWEEK() == 1) and (V3 <= -0.7263889)) or ((DAYOFWEEK() == 2) and (V3 >= -0.7263889 and V3 <= -0.3958333));
    // Highlight the time range
    V4

    #70523
    Matthew
    • Topics: 5
    • Replies: 677
    • Posts: 682

    Hi,

    I’m not 100% sure what your script is trying to do.  In your description you mention looking to mark the 10pm and 4.30pm bar, here’s an example of how that can be done on a 5min Axicorp chart:

    Ex2

    In your example script I am not sure what V2 is trying to do with the addition of – 5/24?  It also looks like you may be trying to limit which days the results appear on?

    When I am doing a script based on intraday time counts, I start by applying the above script showing just the V3 values.  From there I can find the values to reference for the time(s) I want to mark.  Once you have these values you can work on the rest of the script, tailoring it to what you want to show.

    #70545
    Jonathan
    • Topics: 48
    • Replies: 68
    • Posts: 116

    Ahh, maybe the script is incorect.

    but i am trying to only find the Friday closeing price at 5pm NY time which is 10pm on the server. And then Find the Monday 9:30am opening time of NY which is 4:30pm on the server.

    I guess I was trying to highlight only the friday and the monday trading period for those two dates, instead of every single day.

    Hi,

    I’m not 100% sure what your script is trying to do.  In your description you mention looking to mark the 10pm and 4.30pm bar, here’s an example of how that can be done on a 5min Axicorp chart:

    Ex2

    In your example script I am not sure what V2 is trying to do with the addition of – 5/24?  It also looks like you may be trying to limit which days the results appear on?

    When I am doing a script based on intraday time counts, I start by applying the above script showing just the V3 values.  From there I can find the values to reference for the time(s) I want to mark.  Once you have these values you can work on the rest of the script, tailoring it to what you want to show.

    #70557
    Matthew
    • Topics: 5
    • Replies: 677
    • Posts: 682

    Hi,

    DayofWeek() can be used to limit the 10pm and 4.30pm lines to just Friday and Monday.

    Ex3

    1 user thanked author for this post.
    #70561
    Jonathan
    • Topics: 48
    • Replies: 68
    • Posts: 116

    Great addition!

    Can I ask, is there any way to script a horizontal line to reference the 00:00 UTC5 opening hours on the chart each day, at the opening price of that bar?

    #70592
    Matthew
    • Topics: 5
    • Replies: 677
    • Posts: 682

    Hi,

    Yes, the PriceatSignal() function can be used to show the Open price each day at 12am.

    Ex2

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest