NexusFi: Find Your Edge


Home Menu

 





Script with horizontal lines only on the current day


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,313 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?
NinjaTrader Parent Payward Acquires Bitnomial for $550M …
Platforms and Indicators
Prop Firms Are Banning Gold Trading as Record Prices Mak …
Funded Trading Evaluation Firms
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
$24.5 Billion Record Month: Prediction Markets Shatter A …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 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