NexusFi: Find Your Edge


Home Menu

 





Script with horizontal lines only on the current day


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,437 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?
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
UCL Final Kicks Off at Noon ET: PSG at 56.5% as Iran May …
Prediction Markets & Event Contracts
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
 
  #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