Correct Javascript syntax for an object's color. - futures io
futures io



Correct Javascript syntax for an object's color.


Discussion in Tradovate

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




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Correct Javascript syntax for an object's color.

(login for full post details)
  #1 (permalink)
crazybull
Dallas, TX
 
 
Posts: 1 since Sep 2022
Thanks: 0 given, 0 received

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 futures io?
SafeDayTradingorg
Trading Reviews and Vendors
Effect of Bitcoin price on Altcoins
Crypto Futures
convert sierra chart graph to Ninja traders 8
NinjaTrader
TradingView like VOLUME indi for Ninja8 ?!?!
NinjaTrader
AddPlotNames2a support thread
NinjaTrader
 
 
(login for full post details)
  #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: 282 given, 128 received


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 futures io Trade Journal Reply With Quote


futures io Trading Community Platforms and Indicators Tradovate > Correct Javascript syntax for an object's color.


Last Updated on September 28, 2022


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2022 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts