NexusFi: Find Your Edge


Home Menu

 





Script with horizontal lines only on the current day


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,339 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
TRSQ
Montpellier
 
Posts: 6 since Apr 2021
Thanks Given: 3
Thanks Received: 0

I've made this script where the horizontal
line should appear in the chart
,but it applies to all days i'd like to be
applied only on the current day.

def AP = AggregationPeriod.DAY;
def Priorclose = close(period = AP)[1];
def HighOfTheDay = high(period = AP);

plot Red = (HighOfTheDay + Priorclose) / 5 ;
plot green = (HighOfTheDay + Priorclose) *(0.7) ;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
More Than Capable: Hegseths War Warning Validates $114M …
Prediction Markets & Event Contracts
CME Expands 24/7 Trading to WTI Crude Oil and Gold -- We …
Commodities
Iran Fired a Missile at Israel Last Night. The $8M June …
Prediction Markets & Event Contracts
$500M Riding on World Cup 2026: France/Spain Co-Favored …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
TRSQ
Montpellier
 
Posts: 6 since Apr 2021
Thanks Given: 3
Thanks Received: 0

ok seems i've found out how to do it

here is the script if someone is interested:


def day = getDay();
def lastDay = getLastDay();
def AP = AggregationPeriod.DAY;
def Priorclose = close(period = AP)[1];
def HighOfTheDay = high(period = AP);
def isToday = if(day == lastDay, 1, 0);

Plot Half = if isToday then (HighOfTheDay + Priorclose) / 5 else Double.NaN ;

Plot max = if isToday then (((HighOfTheDay - Priorclose)*(0.7))+ Priorclose) else Double.NaN ;


Reply With Quote




Last Updated on April 11, 2021


© 2026 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 - Downloads - Top
no new posts