Simple red-green line (EasyLanguage) - futures io
futures io



Simple red-green line (EasyLanguage)


Discussion in EasyLanguage Programming

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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
 

Simple red-green line (EasyLanguage)

(login for full post details)
  #1 (permalink)
swingbatter
Arlington
 
 
Posts: 15 since Feb 2020
Thanks: 5 given, 2 received

Hi Everyone, I bet there's an easy solution. I just want a way to colorize a line appropriately: Green when the line has a positive slope, red when the line has a negative slope.

Here is my code so far, but the color changes 1 period too late:

plot1(close);
if close >= close[1] then setplotcolor(1,green)
else setplotcolor(1,red);

Attached Thumbnails
Click image for larger version

Name:	red-green line.PNG
Views:	22
Size:	6.7 KB
ID:	317347  
Reply With Quote

Can you help answer these questions
from other members on futures io?
RangeRider for NT8 V10
The Elite Circle
Tradestation 10 work offline
TradeStation
Alternative to Mcginley Dynamic MA
Sierra Chart
How to Register my Company in this Platform
Stocks and ETFs
Simple code to end my indicator
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Vinny E-Mini & Algobox Review TRADE ROOM
284 thanks
Would you share your Holy Grail?
88 thanks
EURUSD M6E/6E Euro
63 thanks
Spoo-nalysis ES e-mini futures S&P 500
47 thanks
TST/OneUp/LeeLoo/Earn2Trade
17 thanks
 
(login for full post details)
  #2 (permalink)
swingbatter
Arlington
 
 
Posts: 15 since Feb 2020
Thanks: 5 given, 2 received

It looks good when I shift the graph to the right 1 period, except of course the time is off.

plot1[-1](c);
if c>=c[1] then setplotcolor(1,green)
else setplotcolor(1,red);

Attached Thumbnails
Click image for larger version

Name:	red-green line2.PNG
Views:	21
Size:	4.4 KB
ID:	317349  
Reply With Quote
 
(login for full post details)
  #3 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,296 since Apr 2013
Thanks: 419 given, 1,531 received


swingbatter,

try shifting the plot color one bar to the left using Setplotcolor[1] instead of shifting the plot.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #4 (permalink)
swingbatter
Arlington
 
 
Posts: 15 since Feb 2020
Thanks: 5 given, 2 received

Haha fantastic! Thank you! I have many uses for this.

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Simple red-green line (EasyLanguage)


Last Updated on September 16, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2021 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