NexusFi: Find Your Edge


Home Menu

 





Quoteboard


Discussion in MultiCharts

Updated
    1. trending_up 1,657 views
    2. thumb_up 4 thanks given
    3. group 0 followers
    1. forum 1 posts
    2. attach_file 3 attachments




 
Search this Thread

Quoteboard

  #1 (permalink)
 
arnie's Avatar
 arnie 
Europe
 
Experience: Advanced
Platform: Jigsaw
Broker: Tradovate
Trading: Equities
Posts: 826 since May 2010
Thanks Given: 763
Thanks Received: 1,048

For those that would like to have a quoteboard on you charts showing today's OHLC, $ and % variation and daily bar.
Only for RTH charts, not 24h.

I also added a couple of custom made alerts for specific symbols.
The folder with the custom sounds is attached for download.




 
Code
{-------------------------------------------------------------------------------------------------}

// Fernando Santos
// MC forum thread : http://www.multicharts.com/discussion/viewtopic.php?f=1&t=11804

// 1st version : 01-23-2013
// 2nd version : 01-24-2013
	// SP (forum member), wrote lines 204 till 208 for a better box alignment
// 3rd version : 01-27-2013
	// SP (forum member), wrote the candle drawing code
	// embed the text_FloatLocation function for better text and trendline (candle) management
	// there's a time input for set the exchange close time so we can have an open/close status
// 4th version : 01-30-2013
	// custom sound alerts were added
	
{-------------------------------------------------------------------------------------------------}

inputs:
	DataBoxLocation			(90), // set as percentage
	VariBoxLocation			(84), // set as percentage
	BoxColor				(rgb(30,30,30)),
	SetDataBoxEndSpace			(2), // align box
	SetVariBoxEndSpace			(2), // align box
	MyDecimals				(2),
	DataLabelColor			(white),
	VariLabelUpColor			(green),
	VariLabelDnColor			(red),
	ShowBoxBorder				(false),
	CloseLabelColor			(rgb(81,81,81)),
	ShowStatus				(true), // show open or close label
	ShowCandle				(true),
	LabelSize				(9),
	LabelFont				("Lucida Sans Typewriter"),
	UseALerts				(true),
	SessionCloseTime			(2115), // time at which the regular trading hour session close
	AlertTimeTrigger			(5), // minutes to trigger alert prior market close
	SymbolAlert				("ES"), // symbol for alerts - ES, NQ, YM, TY, CL, EU
	AlertsLocation			("C:\Sounds"); // folder where alerts sounds are

variables:
	alertTrigger				(0),
	uniqueName				(false),
	isAlertOff				(-1),
	databoxTXT				(-1),
	variBoxTXT				(-1),
	statusTXT				(-1),
	textShift				(0),
	isStartDay				(false),
	isDayOpen				(false),
	dailyHi				(-999999),
	dailyLo				(+999999),
	dailyOp				(0),
	dailyCl				(0),
	prevDailyCl				(0),
	changePct				(0),
	changePrice				(0),
	closeTime				(0),
	intrabarpersist	lastPrice	(0),
	intrabarpersist	DataBox	(0.95),
	intrabarpersist	VariBox	(0.95),
	candleWick				(0), 
	candleBody				(0),
	HighestDispValue			(0),
	LowestDispValue			(0),
	CloseDispValue			(0),
	dayRange				(0),
	hi					(0),
	lo					(0),  
	bottom					(0),
	top					(0),
	ito					(0),
	itc					(0);


// Vertical percentage position function
if LastBarOnChart_s then begin
	HighestDispValue = GetAppInfo(aiHighestDispValue);
	LowestDispValue = GetAppInfo(aiLowestDispValue);
	CloseDispValue = (Close - LowestDispValue)/(HighestDispValue - LowestDispValue);
	
	if DataBoxLocation = -1 or VariBoxLocation = -1 then begin
		if CloseDispValue > 0.6 then begin
			DataBox = 0.05;
			VariBox = 0.05;
		end
		else begin
			if CloseDispValue < 0.4 then begin
				DataBox = 0.95;
				VariBox = 0.95;
			end;
		end;
	end
	else begin
		DataBox = 0.01 * DataBoxLocation;
		VariBox = 0.01 * VariBoxLocation;
	end;
end;

// Reminder to enable alerts	
If UseALerts = true then begin	
	If AlertEnabled = False And LastBarOnChart_S then
	    isALertOff = Text_New_S(Date, Time_S, Low, "Enable alerts at Format Study > Alerts > Enable Alerts"); 
	    	text_setfontname(isAlertOff, "arial black");
	     	text_setsize(isAlertOff, 16);
	   	text_setcolor(isAlertOff, white);
	   	text_setstyle(isAlertOff, 1, 2);
end;
	
if currentbar = 1 then begin
	closeTime = TimeToMinutes(sessionCloseTime) * 60;
	closeTime = SecondsToTime_s(closeTime);
	alertTrigger = secondstotime_s((timetominutes(sessionclosetime) * 60) - (alerttimetrigger * 60));
	
	dataBoxTXT = Text_new_s(date, time_s, high,"");				
		text_setfontname(dataBoxTXT, LabelFont);
		text_setsize(dataBoxTXT, LabelSize);
		text_setstyle(dataBoxTXT, 0, 2);
		text_setborder(dataBoxTXT, ShowBoxBorder);
		text_setbgcolor(dataBoxTXT, boxColor);
		
	variBoxTXT = Text_new_s(date, time_s, high,"");				
		text_setfontname(variBoxTXT, LabelFont);
		text_setsize(variBoxTXT, LabelSize);
		text_setstyle(variBoxTXT, 0, 2);
		text_setborder(variBoxTXT, ShowBoxBorder);
		text_setbgcolor(variBoxTXT, boxColor);

	if ShowStatus = true then begin
		statusTXT = Text_new_s(date, time_s, high,"");				
			text_setfontname(statusTXT, LabelFont);
			text_setsize(statusTXT, LabelSize);
			text_setstyle(statusTXT, 1, 2);
	end;
end;

tl_delete (candleWick); 
tl_delete (candleBody);

if date <> date[1] then begin
	isStartDay = true;
	dailyHi = -999999;
	dailyLo = +999999;
	isDayOpen = false;
	dailyCl = close[1];
	uniqueName = true;
end;

if isStartDay then begin
	// Set day's high, low and range
	if High > dailyHi then
		dailyHi = High;
	if Low < dailyLo then
		dailyLo = Low;
		hi = dailyHi;
		lo = dailyLo;
		dayRange = hi - lo;
		
	lastPrice = close;
	
	// Set open
	if isDayOpen = false then begin
		isDayOpen = true;
		dailyOp = Open;
	end;
	
	// Candle wick
	top =  LowestDispValue + (DataBox * (HighestDispValue - LowestDispValue));
	bottom =  LowestDispValue + (VariBox * (HighestDispValue - LowestDispValue));

	// Candle body
	if dayRange <> 0 then begin
		itc = ((lastPrice - dailyLo) / dayRange) * (top-bottom) + bottom;
		ito = ((dailyOp - dailyLo) / dayRange) * (top-bottom) + bottom;
	end;
	
	// Candle lines
	if ShowCandle = true then begin
		candleWick = tl_new_s(date, time_s, bottom, date, time_s, top);
			tl_setsize (candleWick, 2);
			tl_setcolor(candleWick,lightgray);
			
		candleBody = tl_new_s(date, time_s, ito, date, time_s, itc);   
			tl_setsize (candleBody, 4);
			
		if lastPrice > dailyOp then
			tl_setcolor(candleBody, VariLabelUpColor)
		else 
			tl_setcolor(candleBody, VariLabelDnColor);
	end;

	// Daily variation
	if dailyCl <> 0 then
		changePct = absvalue(((lastPrice / dailyCl) - 1) * 100);
	
	changePrice = absvalue(lastPrice - dailyCl);

	// Alerts
	if UseALerts = true then begin
		if time_s = alertTrigger and barstatus = 2 and LastBarOnChart_s then begin
			if SymbolAlert = "ES" then begin
				Alert("S&P futures will close in " + numtostr(AlertTimeTrigger, 0) + " minutes"); 
				PlaySound(AlertsLocation + "\ESclosein5min.wav");
			end
			else
			if SymbolAlert = "NQ" then begin
				Alert("Nasdaq futures will close in " + numtostr(AlertTimeTrigger, 0) + " minutes"); 
				PlaySound(AlertsLocation + "\NQclosein5min.wav");
			end
			else
			if SymbolAlert = "YM" then begin
				Alert("Dow Jones futures will close in " + numtostr(AlertTimeTrigger, 0) + " minutes"); 
				PlaySound(AlertsLocation + "\YMclosein5min.wav");
			end
			else
			if SymbolAlert = "TY" then begin
				Alert("10 year note will close in " + numtostr(AlertTimeTrigger, 0) + " minutes"); 
				PlaySound(AlertsLocation + "\TYclosein5min.wav");
			end
			else
			if SymbolAlert = "EU" then begin
				Alert("Euro futures will close in " + numtostr(AlertTimeTrigger, 0) + " minutes"); 
				PlaySound(AlertsLocation + "\EUclosein5min.wav");
			end
			else
			if SymbolAlert = "CL" then begin
				Alert(" Crude Oil futures will close in " + numtostr(AlertTimeTrigger, 0) + " minutes"); 
				PlaySound(AlertsLocation + "\CLclosein5min.wav");
			end;
		end
		else
		if time_s = closeTime and barstatus = 2 and LastBarOnChart_s then begin
			if SymbolAlert = "ES" then begin
				Alert("S&P futures just closed for the day"); 
				PlaySound(AlertsLocation + "\ESisclosed.wav");
			end
			else
			if SymbolAlert = "NQ" then begin
				Alert("Nasdaq futures just closed for the day"); 
				PlaySound(AlertsLocation + "\NQisclosed.wav");
			end
			else
			if SymbolAlert = "YM" then begin
				Alert("Dow Jones futures just closed for the day"); 
				PlaySound(AlertsLocation + "\YMisclosed.wav");
			end
			else
			if SymbolAlert = "TY" then begin
				Alert("10 year note just closed for the day"); 
				PlaySound(AlertsLocation + "\TYisclosed.wav");
			end
			else
			if SymbolAlert = "EU" then begin
				Alert("Euro futures just closed for the day"); 
				PlaySound(AlertsLocation + "\EUisclosed.wav");
			end
			else
			if SymbolAlert = "CL" then begin
				Alert("Crude Oil just closed for the day"); 
				PlaySound(AlertsLocation + "\CLisclosed.wav");
			end;
		end;
	end;
	
	// Color settings
	if time_s < closeTime then begin
		text_setstring(statusTXT , "O \nP \nE \nN");
		text_setcolor(dataBoxTXT , DataLabelColor);
		text_setcolor(statusTXT, rgb(81,81,81));
		
		if lastPrice > dailyCl then
			text_setcolor(variBoxTXT , VariLabelUpColor)
		else 
			text_setcolor(variBoxTXT , VariLabelDnColor);
					
		if lastPrice > dailyOp then
			tl_setcolor(candleBody, VariLabelUpColor)
		else 
			tl_setcolor(candleBody, VariLabelDnColor);
	end
	else
	if time_s = closeTime and barstatus = 2 and LastBarOnChart_s then begin
		text_setstring(statusTXT , "C \nL \nO \nS \nE");
		
		text_setcolor(variBoxTXT , CloseLabelColor);
		text_setcolor(dataBoxTXT , CloseLabelColor);
		text_setcolor(statusTXT, white);
		
		//if lastPrice >= dailyOp or lastPrice <= dailyOp then begin
			//tl_setcolor(candleBody, CloseLabelColor);
			//tl_setcolor(candleWick, CloseLabelColor);
		//end;
	end;
	
	// DataBox
	text_setstring(dataBoxTXT, "   < " + text(getsymbolname) + " > " + NewLine + 
		spaces(1) + " OP |" + " " + NumToStr(dailyOp, MyDecimals) + spaces(SetDataBoxEndSpace) + NewLine +
		spaces(1) + " HI |" + " " + NumToStr(dailyHi, MyDecimals) + spaces(SetDataBoxEndSpace) + NewLine +
		spaces(1) + " LO |" + " " + NumToStr(dailyLo, MyDecimals) + spaces(SetDataBoxEndSpace) + NewLine +
		spaces(1) + " CL |" + " " + NumToStr(lastPrice, MyDecimals) + spaces(SetDataBoxEndSpace)) ;

	// VariBox
	text_setstring(variBoxTXT , spaces(1) + "  % | " + NumToStr(changePct, 2) + 
		Spaces(StrLen(NumToStr(changePct, 2)) - StrLen(NumToStr(changePrice, 1))) + 
		spaces(SetVariBoxEndSpace) + NewLine +
		spaces(1) + " CH | " + NumToStr(changePrice, MyDecimals) + 
		Spaces(StrLen (NumToStr(lastPrice, MyDecimals)) - StrLen(NumToStr(changePrice, MyDecimals))) + spaces(SetVariBoxEndSpace)) ;

	// Data and Vari box location
	text_setlocation_s(dataBoxTXT, date, time_s, LowestDispValue + (DataBox * (HighestDispValue - LowestDispValue)));
	text_setlocation_s(variBoxTXT, date, time_s, LowestDispValue + (VariBox * (HighestDispValue - LowestDispValue)));
	
	// Status location
	if ShowStatus = true then
		text_setlocation_s(statusTXT, date, time_s, LowestDispValue + (DataBox * (HighestDispValue - LowestDispValue)));
end;

We can also create something similar to this:



But here I advise you to delete/comment all code related to the status open/close.
Since we have different markets here with different open and close times the status does not work properly.

If I become half a percent smarter each year, I'll be a genius by the time I die
Attached Files
Elite Membership required to download: Sounds.zip
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didnĀ“t know anyth …
Psychology and Money Management
Quant vue
Trading Reviews and Vendors
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
 
  #2 (permalink)
 
arnie's Avatar
 arnie 
Europe
 
Experience: Advanced
Platform: Jigsaw
Broker: Tradovate
Trading: Equities
Posts: 826 since May 2010
Thanks Given: 763
Thanks Received: 1,048

It seems the last image posted above, showing several markets in the same chart is missing...
I post it again for reference.


If I become half a percent smarter each year, I'll be a genius by the time I die
Started this thread Reply With Quote
Thanked by:




Last Updated on February 13, 2013


© 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