futures io



TS - Need color changes when MACD & RSI on crossing zero


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one bobwest with 1 posts (0 thanks)
    2. looks_two Marco44 with 1 posts (0 thanks)
    3. looks_3 UHoser with 1 posts (0 thanks)
    4. looks_4 Shaban with 1 posts (2 thanks)
    1. trending_up 337 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 3 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
 

TS - Need color changes when MACD & RSI on crossing zero

(login for full post details)
  #1 (permalink)
 UHoser 
Springfield, MA
 
Experience: Intermediate
Platform: Ninja, TradeStation
Trading: Futures and Options
 
UHoser's Avatar
 
Posts: 2 since Dec 2011
Thanks: 1 given, 0 received

Hi

I am looking for a little help, writing code for a TradeStation indicator might be above my pay grade and was wondering if someone, who is more knowledgeable with making a possible minor adjustment or two, to the standard TradeStation MACD and the RSI indicators and would be able to help out.

What I would like to have as an additional input setting, that I would have the ability to change the color of each line, in each indicator, the MACD line and the RSI line, so that whenever it crossed their specific zero line, either from above or from below, that I would have the ability to select a different color for either line on a cross?

If possible, a second input option, would be to change the color the chart background or by plotting a vertical line on the chart, whenever there was a cross that occurred. Also if the chart background would be easier, then I might need the ability to change to the color intensity as well

As an example, when crossing from above and after closing below the zero line, going from say a green to a red color and crossing and closing back above from below, going from a red to a green color line.

I would be very appreciative of any help

UHoser

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
ninja trdaer order blocks, orice action ict
NinjaTrader
Trading instruments in different base currencies - how t …
Brokers
I wonder and I ask you…
Psychology and Money Management
Sierra Chart SC time and sales question
Sierra Chart
DefineDLLFunc C++ Example
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
28 thanks
New NinjaTrader
18 thanks
futures io site changelog and issues/problem reporting
16 thanks
Unsubscribe from Threads
14 thanks
Not enough skin in the game?
10 thanks
 
(login for full post details)
  #2 (permalink)
 bobwest 
Site Moderator
Sarasota FL
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
 
bobwest's Avatar
 
Posts: 7,768 since Jan 2013
Thanks: 55,648 given, 25,521 received


UHoser View Post
Hi

I am looking for a little help, writing code for a TradeStation indicator might be above my pay grade and was wondering if someone, who is more knowledgeable with making a possible minor adjustment or two, to the standard TradeStation MACD and the RSI indicators and would be able to help out.

What I would like to have as an additional input setting, that I would have the ability to change the color of each line, in each indicator, the MACD line and the RSI line, so that whenever it crossed their specific zero line, either from above or from below, that I would have the ability to select a different color for either line on a cross?

If possible, a second input option, would be to change the color the chart background or by plotting a vertical line on the chart, whenever there was a cross that occurred. Also if the chart background would be easier, then I might need the ability to change to the color intensity as well

As an example, when crossing from above and after closing below the zero line, going from say a green to a red color and crossing and closing back above from below, going from a red to a green color line.

I would be very appreciative of any help

UHoser

@UHoser, there are many good TradeStation programmers here who will probably be willing to help you. This appears to be a simple modification to both indicators.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
 
(login for full post details)
  #3 (permalink)
Shaban
Turin + Italy
 
 
Posts: 180 since Feb 2020
Thanks: 20 given, 109 received


Hi,

the RSI cannot go below zero, because it is an oscillator that moves between 0 and 100, and so I put in the color green when it goes above 50 and red when it goes below 50;

you try and see if these 2 solutions work for you (see pictures):

MACD with 2 colors: https://postimg.cc/3dxbJq15

RSI with 2 colors: https://postimg.cc/r0gCB8vd


------------------------------------------------------------------------

{MACD with 2 colors}

inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: MyMACD( 0 ), MACDAvg( 0 ), OverSColor( Red ), OverBColor( Green ) ;


MyMACD = MACD( Close, FastLength, SlowLength ) ;
MACDAvg = XAverage( MyMACD, MACDLength ) ;

Plot1( MyMACD, "MACD" ) ;
Plot2( MACDAvg, "MACDAvg", Darkgreen) ;
Plot3( 0, "ZeroLine", Blue ) ;

{ Color criteria }
if MyMACD > 0 then
SetPlotColor( 1, OverBColor )
else if MyMACD < 0 then
SetPlotColor( 1, OverSColor ) ;

-----------------------------------------------------------------------------


{RSI with 2 colors}

inputs:
Price( Close ),
Length( 14 ),
OverSold( 30 ),
OverBought( 70 ),
OverSColor( Red ),
OverBColor(Green) ;

variables: MyRSI( 0 ) ;

MyRSI = RSI( Price, Length ) ;

Plot1( MyRSI, "RSI" ) ;
Plot2( OverBought, "OverBot" ) ;
Plot3( OverSold, "OverSld" ) ;
Plot4( 50, "MidLine", Darkgreen ) ;


{ Color criteria }
if MyRSI > 50 then
SetPlotColor( 1, OverBColor )
else if MyRSI < 50 then
SetPlotColor( 1, OverSColor ) ;


---------------------------------------------------------------------------

Reply With Quote
The following 2 users say Thank You to Shaban for this post:
 
(login for full post details)
  #4 (permalink)
Marco44
Chicago, USA
 
 
Posts: 3 since Jan 2023
Thanks: 2 given, 1 received

Have you tried having chat GPT write the code for you? I have used chat GPT to write several Scripps for tradingView and I t’s surprising how useful it can be. Just make sure your specific in your instructions. It’s also iterative, so you can keep narrowing things down until you get what you’re looking for. Good luck!

Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > TS - Need color changes when MACD & RSI on crossing zero


Last Updated on March 14, 2023


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