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



Simple red-green line (EasyLanguage)


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,244 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 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
 

Simple red-green line (EasyLanguage)

(login for full post details)
  #1 (permalink)
swingbatter
Arlington
 
 
Posts: 18 since Feb 2020
Thanks: 6 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:	70
Size:	6.7 KB
ID:	317347  
Reply With Quote

Can you help answer these questions
from other members on futures io?
Multi Time Frame High/Low/Median levels
NinjaTrader
Market on Close data within IB
Platforms and Indicators
help with take profit several targets
TradeStation
Big Mo Indicator for NT8
NinjaTrader
How do I create Strategy with the Second Entry indicator
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
123 thanks
ApexTraderFunding.com experience and review
11 thanks
Dax market profile (FDAX, TPO)
7 thanks
Want your NinjaTrader indicator created, free?
7 thanks
Artificial Intelligence (AI) and Chat GPT
7 thanks
 
(login for full post details)
  #2 (permalink)
swingbatter
Arlington
 
 
Posts: 18 since Feb 2020
Thanks: 6 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:	58
Size:	4.4 KB
ID:	317349  
Reply With Quote
 
(login for full post details)
  #3 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,360 since Apr 2013
Thanks: 426 given, 1,578 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: 18 since Feb 2020
Thanks: 6 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 © 2023 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