NexusFi: Find Your Edge


Home Menu

 





Correct Javascript syntax for an object's color.


Discussion in Tradovate

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




 
Search this Thread
  #1 (permalink)
crazybull
Dallas, TX
 
Posts: 1 since Sep 2022
Thanks Given: 0
Thanks Received: 0

I am developing a custom indicator for the
Tradovate platform.

I've created a color selector for one of the
objects that is plotted. The selector code is:

schemeStyles:
{
dark:
{
hldojiUp: {color: "white"},
hldojiDn: {color: "yellow"},
}
}

I would like to apply the selected color to
another object in my indicator. My question is
what is the correct pathname to reference
and reassign the color of hldojiUp or hldojiDn
to another variable or object?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Free Supply and Demand Zones Indicator for NinjaTrader 8 …
NinjaTrader
Half-life over Cointegration?
Traders Hideout
Tradestation Chart Setup
TradeStation
Small Indicator to visually see Nth Bar Close - NT8
Traders Hideout
Bob Volman ES Scalping
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NinjaTrader Performance on 6 year Laptop Vs. NEW
9 thanks
Tariffs and what comes next...
4 thanks
How to address loneliness for a trader?
4 thanks
Gradient Divergence Trading
4 thanks
Composite Indicator for ninjatrader 8?
1 thanks
  #2 (permalink)
 metalhe4der 
Regina, Canada
 
Experience: Intermediate
Platform: Sierra Chart, TradingView
Broker: Optimus (AMP Futures), CQG, Rithmic
Trading: ES
Posts: 140 since Mar 2016
Thanks Given: 284
Thanks Received: 128


crazybull View Post
I am developing a custom indicator for the
Tradovate platform.

I've created a color selector for one of the
objects that is plotted. The selector code is:

schemeStyles:
{
dark:
{
hldojiUp: {color: "white"},
hldojiDn: {color: "yellow"},
}
}

I would like to apply the selected color to
another object in my indicator. My question is
what is the correct pathname to reference
and reassign the color of hldojiUp or hldojiDn
to another variable or object?

Hey, not sure if I fully understand the question, but if I understand correctly, you're asking how to access either hldojiUp/hldojiDn values?

Assuming schemeStyles is a variable, and not a key in another object (you used schemeStyles: {} syntax, which is referencing a key, vs schemeStyles = {}, which is referring to an assignment) console.logging the following would result in 'white':
 
Code
  const schemeStyles = {
  dark: {
    hldojiUp: {color: "white"},
    hldojiDn: {color: "yellow"},
  }
 };

console.log(schemeStyles.dark['hldojiUp']['color']) --> "white"
You'll need to make sure that the object keys you're referencing are in quotes to indicate a String.


Trade in the present: what do you see developing today?
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on September 28, 2022


© 2025 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