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,486 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
Search this Thread

Remove plot from chart

  #1 (permalink)
 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 Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
23 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 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 Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

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 Reply With Quote
  #5 (permalink)
 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 Reply With Quote
  #6 (permalink)
 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 Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

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 Reply With Quote
  #8 (permalink)
 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 Reply With Quote




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