NexusFi: Find Your Edge


Home Menu

 





Remove plot from chart


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one haonkered with 4 posts (0 thanks)
    2. looks_two ABCTG with 2 posts (0 thanks)
    3. looks_3 selnomeria with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,474 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
 

Remove plot from chart

 
 haonkered 
Houston, Texas, United States
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 5

Can someone help me with the below code. Basically I have taken the OBV indicator and modified it so that I can see how many days back the OBV crossed over the mov average of the OBV.

I robbed and stole code from macd to get the counting and color coding but on my OBV indicator in the chart it is showing a line at 0 with the color coding and I dont want it to show that.

Thanks in advance for any help

 
Code
inputs:
	AlertLength( 14 ),
	AvgLength( 20 ),
	int OBV_Up_Color( Green ), { color to be used to plot positive
	 values of MACDDiff }
	int OBV_Down_Color( Red ), { color to be used to plot 
	 negative values of MACDDiff }
	int BackgroundColorAlertCell( DarkGray ) ; { if alert criteria are met, this is
	 the color used for the cell background in RadarScreen;  if it is not desired
	 for the cell background color to change when the alert criteria are met, set
	 this input to the default cell background color }
	 
variables:
	intrabarpersist bool PlotCrossBarsAgo( false ),
	double OBVValue( 0 ),
	double OBVAvg ( 0 ),
	double HistogramColor( 0 ),
	int CrossBarsAgo( 0 );							

once
	begin
	{ if the application is something other than Charting, like RadarScreen, then
 	 set PlotCrossBarsAgo to true to indicate that the number of bars ago that the
 	 last cross	occurred is to be plotted;  this value is not
 	 plotted in Charting since it is on a different scale than the parabolic
 	 itself } 		
	PlotCrossBarsAgo = GetAppInfo( aiApplicationType ) <> cChart ;
	end ;

OBVValue = OBV ;
OBVAvg = AverageFC( OBVValue, AvgLength ) ;		//Added Avg

HistogramColor = IFF( OBVValue > OBVAvg, OBV_Up_Color, OBV_Down_Color ) ;


Plot1( OBVValue, "OBV", HistogramColor ) ;
Plot2( OBVAvg, "OBVma" ) ;						//Added Avg

{ Alert criteria }
if LowestBar( C, AlertLength ) = 0 and LowestBar( OBVValue, AlertLength ) > 0 then 
	Alert( "Bullish divergence - new low not confirmed" ) 
else if HighestBar( C, AlertLength ) = 0 and HighestBar( OBVValue, AlertLength ) > 0 then
	Alert( "Bearish divergence - new high not confirmed" ) ;

if ( OBVValue > OBVAvg and OBVValue[1] <= OBVAvg[1] ) or ( OBVValue < OBVAvg and OBVValue[1] >= OBVAvg[1] )
 then
	CrossBarsAgo = 0
else
	CrossBarsAgo += 1 ;


if PlotCrossBarsAgo = false then
SetPlotBGColor (3, Black); 
Plot3( CrossBarsAgo, "OBV Trig", HistogramColor ) ;

if OBVValue crosses over OBVAvg then
	begin
	SetPlotBGColor( 3, BackgroundColorAlertCell ) ;
	Alert( "OBV Crossing Over OBVAvg" ) ;
	end
else if OBVValue crosses under OBVAvg then
	begin
	SetPlotBGColor( 3, BackgroundColorAlertCell ) ;
	Alert( "OBV Crossing Under OBVAvg" ) ; 
	end ;

Started this thread

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
18 thanks
The Program
18 thanks
 
 haonkered 
Houston, Texas, United States
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 5




Example of problemo

Started this thread
 
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

haonkered,

what exactly do you want to remove? You said that you "modified it so that I can see how many days back the OBV crossed over the mov average of the OBV", which seems to be the line near 0 (Plot3). And now you want to remove that line you added as modification?

Regards,
ABCTG

Follow me on Twitter
 
 haonkered 
Houston, Texas, United States
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 5

Sorry should have been clearer. I am tracking these days in radarscreen - but do not want to see that line in the chart.

Started this thread
 
 haonkered 
Houston, Texas, United States
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 5

Actually figured out the solution, quite simple just an error I made.

Old Code
 
Code
if PlotCrossBarsAgo then
SetPlotBGColor (3, Black); 
Plot3( CrossBarsAgo, "OBV-T", HistogramColor ) ;



New Code
 
Code
if PlotCrossBarsAgo then 
	Plot3( CrossBarsAgo, "CrossBarsAgo", HistogramColor ) ;

SetPlotBGcolor (3, Black);

Started this thread
 
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

haonkered,

in your new code "SetPlotBGcolor (3, Black);" will always be executed, as it's not part of the "if PlotCrossBarsAgo ..." check. In case you intended it like that, fine.
You can also let the program figure out if the study is running in the Radarscreen or on the chart.

 
Code
//study is applied in Radarscreen
if GetAppInfo(Aiapplicationtype) = 2 then
Plot3( CrossBarsAgo, "OBV-T", HistogramColor ) ;
Regards,
ABCTG


haonkered View Post
Actually figured out the solution, quite simple just an error I made.

Old Code
 
Code
if PlotCrossBarsAgo then
SetPlotBGColor (3, Black); 
Plot3( CrossBarsAgo, "OBV-T", HistogramColor ) ;



New Code
 
Code
if PlotCrossBarsAgo then 
	Plot3( CrossBarsAgo, "CrossBarsAgo", HistogramColor ) ;

SetPlotBGcolor (3, Black);


Follow me on Twitter
 
 selnomeria 
Tbilisi + Georgia
 
Experience: None
Platform: ThinkScript,Tradestation
Trading: EUR/USD
Posts: 36 since Aug 2014
Thanks Given: 9
Thanks Received: 20

use background color to remove/hide plot:

 
Code
SetPlotColor(1, GetBackgroundColor)

Visit my NexusFi Trade Journal

 



Last Updated on December 15, 2014


© 2024 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 - Privacy Policy - Downloads - Top
no new posts