The Economic Events Collection for MultiCharts - futures io
futures io



The Economic Events Collection for MultiCharts


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one Nicolas11 with 10 posts (21 thanks)
    2. looks_two Jura with 9 posts (46 thanks)
    3. looks_3 Wouter with 5 posts (2 thanks)
    4. looks_4 knias with 3 posts (0 thanks)
      Best Posters
    1. looks_one Jura with 5.1 thanks per post
    2. looks_two Nicolas11 with 2.1 thanks per post
    3. looks_3 SARdynamite with 2 thanks per post
    4. looks_4 Locust with 1.7 thanks per post
    1. trending_up 17,800 views
    2. thumb_up 83 thanks given
    3. group 23 followers
    1. forum 51 posts
    2. attach_file 18 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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
 

The Economic Events Collection for MultiCharts

(login for full post details)
  #31 (permalink)
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,755 received

@Jura informed me that v4 was not downloading events which happen at the same time as the previous event. It was due to another change in the structure of Forex Factory calendar.

Enclosed please find a new version (v5) of EconomicEventsDownloader.jar which corrects this issue.

As for previous versions, the enclosed ZIP also contains source code. This source code is useless for the execution of EconomicEventsDownloader.jar. It is just given as a reference if, for any reason (for instance: security), you prefer to review the code and compile yourself the .jar file.

I have not tested it. I mean... it works, but I have not made deep tests in order to check that the output files fully correspond to the content of Forex Factory calendar. Please check it if you want to use it.

Nicolas

Attached Files
Register to download File Type: zip EconomicEventsDownloader_v5.zip (26.2 KB, 57 views)
Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to Nicolas11 for this post:

Can you help answer these questions
from other members on futures io?
Script to add a moving average
ThinkOrSwim
Using Heikin Ashi bars on NQ/ES
Emini and Emicro Index
Is there inherently more opportunity in smaller markets?
Traders Hideout
uptick/downtick vs bid/ask
NinjaTrader
Bars repainting
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Question about intraday margins
52 thanks
How quickly do algos go bad?
40 thanks
ZombiePack3 Indicators
19 thanks
Webinar: Building a System for Trading Psychology w/Jare …
18 thanks
Want your NinjaTrader indicator created, free?
15 thanks
 
(login for full post details)
  #32 (permalink)
 DarrenH 
Cotswolds UK
 
Experience: Intermediate
Platform: NT7, Multicharts
Broker: Mirus,Amp,ZenFire
Trading: Fdax
 
DarrenH's Avatar
 
Posts: 64 since Mar 2010
Thanks: 95 given, 23 received

Hi Jura

I placed the .dll file in C:\Program Files\TS Support\MultiCharts64, but i seem to still get the error.

IS it a 64 bit MC thing or maybe i am doing something wrong.

OK i had the 32bit file all ok thanks

Many Thanks

DarrenH


Jura View Post
You should place the .DLL file in the MultiCharts directory, not the folder itself since then MultiCharts can't find it.

Like this:



Let us know how that goes.


Reply With Quote
 
(login for full post details)
  #33 (permalink)
 bomberone1 
London
 
Experience: Beginner
Platform: MultiCharts
 
Posts: 240 since Nov 2010
Thanks: 10 given, 23 received


Is it possible load more historical data and have a time clock count down to economic event and a forecast from
Forex Factory
or fxcm website?

Why this nice tool is not native included in mc?

Reply With Quote
 
(login for full post details)
  #34 (permalink)
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,755 received

Hi @bomberone1

I am (was) in charge of the Java part for downloading, so I will only answer to "Is it possible load more historical data" question.

When previous versions of the tool were designed, downloading data from ForexFactory was only possible back to 2009. Now, it seems OK back to 2007.

So, enclosed please find a new version (v5.1) of EconomicEventsDownloader.jar which downloads back to 2007 (instead of 2009 in v5). It is the only change.

As for previous versions, the enclosed ZIP also contains source code. This source code is useless for the execution of the jar file. It is just given as a reference if, for any reason (for instance: security), you prefer to review the code and compile yourself the .jar file.

I have not tested it. I mean... it works, but I have not made deep tests in order to check that the output files fully correspond to the content of Forex Factory calendar. Please check it if you want to use it.

Nicolas

Attached Files
Register to download File Type: zip EconomicEventsDownloader_v5.1.zip (26.3 KB, 104 views)
Visit my futures io Trade Journal Reply With Quote
The following 6 users say Thank You to Nicolas11 for this post:
 
(login for full post details)
  #35 (permalink)
 SARdynamite 
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
 
Posts: 292 since Dec 2009
Thanks: 243 given, 110 received

Fantastic tool. Wish there was an equivalent for NinjaTrader for economic news filtering during backtests.
It can definitely help to stay clear of some unwanted drawdowns on some markets.

Reply With Quote
The following 2 users say Thank You to SARdynamite for this post:
 
(login for full post details)
  #36 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,127 since Jun 2009
Thanks: 32,599 given, 98,768 received


SARdynamite View Post
Fantastic tool. Wish there was an equivalent for NinjaTrader for economic news filtering during backtests.
It can definitely help to stay clear of some unwanted drawdowns on some markets.

Start a separate thread for NinjaTrader. I know users have created such a thing, @MWinfrey I believe for one. Also a simple test for if (Time[0] == Time[1]) will help to not trade during news events because for non-time based bars (ie: range bars) they will move quickly with identical timestamps in NT, and you can know to not trade under that circumstance.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
(login for full post details)
  #37 (permalink)
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,755 received

For completeness purpose, enclosed please find documentation for the Java tool which downloads economic events from Forex Factory.

Nicolas

Attached Thumbnails
The Economic Events Collection for MultiCharts-economic-events-downloader-v.5.1-documentation.pdf  
Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to Nicolas11 for this post:
 
(login for full post details)
  #38 (permalink)
 ausstone 
Miami, FL / USA
 
Experience: Intermediate
Platform: MultiCharts
Trading: Futures, Forex
 
Posts: 14 since Feb 2013
Thanks: 0 given, 2 received

there seems to be a few examples of this using future news events. I am trying to create an indicator that plots historical events by showing it as a 0 for no news on the bar or 1 for news on that bar. i am using EE.GetHistoricalEvents but seem to be having all sorts of issues. could someone post a simple example of this in indicator form and not as some pop up. I am doing this because I want to use it in back testing.

thanks

Reply With Quote
 
(login for full post details)
  #39 (permalink)
 Jura   is a Vendor
 
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 688 received


ausstone View Post
could someone post a simple example of this in indicator form and not as some pop up. I am doing this because I want to use it in back testing.

See the code below, which highlights economic events with an arrow and text. It's not 'production ready' (and therefore not "officially" published), but should give you more than enough to start with:

 
Code
Inputs:
	NameOfList("myHistList"),
	RegionsToKeep("EUR;USD;GBP"),
	ChopUpStrings(False),
	Ticks_OffSet(8),
	HighImpact_Color(Red),
	MediumImpact_Color(yellow),
	LowImpact_Color(cyan),
	DisplayArrow(True),
	Arrow_Size(5),
	DisplayLine(True),
	Line_Width(1),
	Line_Style(2),
	DisplayText(True),
	Text_FontSize(10),				
	Text_FontName("Lucida Sans Typewriter"),
	Text_FontColor(white);

Variables:
	tickOffSet( Ticks_OffSet * MinMove), //(Power(10, Round(Log(PriceScale) / Log(10), 0)) / MinMove) ),
	tickSize(MinMove / PriceScale), 
	dtEconEvent(0), prevDtEconEvent(0), dtNextBar(0), dtPrevBar(0), indexNumber(1),
	firstDate(0), firstTime(0), arrowID(0), textID(0), tlID(0), loopDoneForBar(False), impactOfEvent(0),
	listLength(0),
	x(0), y(0), z(0);

if (CurrentBar = 1) then begin 
	 firstDate = Date;
	 firstTime = Time_s;
end;

Arrays:
	barPrice[](0), barDT[](0), barPriceLow[](0);

once cleardebug;

// Collect data
if (BarStatus(1) = 2) then begin 
	x = Array_GetMaxIndex(barPrice);
	
	Array_SetMaxIndex(barPrice, x + 1);
	Array_SetMaxIndex(barDT, x + 1);
	Array_SetMaxIndex(barPriceLow, x + 1);
	
	barPrice[x+1]  	= Highest(High, 10);  //High;
	
	if (x > 10) then 
		barPrice[x+1-10] 	= Highest(High, 20);
	
	barDT[x+1] 			= ELDateToDateTime(Date) + ELTimeToDateTime_s(Time_s);
	barPriceLow[x+1]	= Low - (MinMove * 2);
	
end; //: Data collection


if (LastBarOnChart_s = True) and (BarStatus(1) = 2) and (GetAppInfo(aiRealTimeCalc) = 0) then begin 

	// Generate economic events list
	once begin 
	
		value1 = EE.GetHistoricalEvents(NameOfList, firstDate, Date);
//		value1 = EE.GetFutureEvents(NameOfList);
		value1 = EE.KeepTimeRange(NameOfList, SessionStartTime(0, DayOfWeek(Date)), SessionEndTime(0, DayOfWeek(Date)));
		value1 = EE.KeepRegions(NameOfList, RegionsToKeep);			// Only keep the specified regions in the list
		value1 = EE.RemoveImpact(NameOfList, 0);							// Remove all events with impact 0 (i.e. bank holiday)
	
		// Note: uncomment the line below to see which Economic Events are in the list after the filtering functions. (For debugging purposes)
//		EE.PrintToOutputLog(NameOfList); 
	end;

	Print("Lengt of bar array: ", array_getmaxindex(barPrice), "  and barDt: ", array_getmaxindex(barDT));
	
	dtEconEvent 	= EE.DateTimeOfEvent(NameOfList, indexNumber);	
	listLength 		= EE.GetMaxIndex(NameOfList);
	
	z = 1;
	y = 1;
	value1 = 1;
	value2 = 1;
	
	// Loop through data
	for x = 1 to Array_GetMaxIndex(barDT) - 1 begin 
	
		// if there are multiple economic events on this time
		for z = 0 to 9 begin
		
			if (IntPortion(barDT[x]) = IntPortion(dtEconEvent)) and (barDT[x-1] < dtEconEvent) and (barDT[x+1] > dtEconEvent) then begin 
			
				Print("PrevBar: ", DateTimeToStr(barDT[x-1]), " Event: ", DateTimeToStr(dtEconEvent), "  next bar: ", DateTimeToStr(barDT[x+1]));
				Print(Spaces(2), "Date of event: ", FormatDate("dd-MM-yy", ELDateToDateTime(EE.DateList(NameOfList, indexNumber))),
						"  Time of event: ", FormatTime("HH:mm:ss", ELTimeToDateTime(EE.TimeList(NameOfList, indexnumber))),
						"  name of event: ", EE.EventList(NameOfList, indexNumber));
						
				// Plot
				if (z = 0) then begin 
					
					if (DisplayText = True) then
				
						textID = Text_New_s(EE.DateList(NameOfList, indexNumber), 
									EE.TimeList(NameOfList, indexNumber) * 100,
									barPrice[x] + (tickSize * 2) + Arrow_Size, 
									IffString(ChopUpStrings = True, 
										StrChopUp(Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")")),
										Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")")
									));
					
					if (DisplayArrow = True) then 
					
						arrowID = Arw_New_s(EE.DateList(NameOfList, indexNumber), 
													EE.TimeList(NameOfList, indexNumber) * 100,
													barPrice[x], True);
					
					if (DisplayLine = True) then 							
					 	tlID = TL_New_s(EE.DateList(NameOfList, indexNumber),
					 						EE.TimeList(nameOfList, indexNumber) * 100,
					 						barPriceLow[x],
					 						EE.DateList(NameOfList, indexNumber),
					 						EE.TimeList(nameOfList, indexNumber) * 100,
					 						barPriceLow[x] * 0.85);
					 		
			 									
				end //: z = 0
				
				else if (DisplayText = True) then
					value1 = Text_SetString(textID, Text(Text_GetString(textID), NewLine, "&", NewLine,
								IffString(ChopUpStrings = True,
									StrChopUp(Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")")),
									Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")"))	
								));
				
				// Formatting
				value6 = Text_SetSize(textID, Text_FontSize);
				value6 = Text_SetFontName(textID, Text_FontName);
				value6 = Text_SetStyle(textID, 0, 1);
				value6 = Text_SetColor(textID, Text_FontColor);
				
				value7 = Arw_SetSize(arrowID, Arrow_Size);
				
				value8 = TL_SetStyle(tlID, Line_Style);
				value8 = TL_SetSize(tlID, Line_Width);
				
				impactOfEvent = EE.ImpactList(NameOfList, indexNumber);
				
				switch (impactOfEvent) begin 
				
					case 1: 				// low impact
						value5 = Arw_SetColor(arrowID, LowImpact_Color);
						value5 = TL_SetColor(tlID, LowImpact_Color);
					
					case 2:				// medium
						value5 = Arw_SetColor(arrowID, MediumImpact_Color);
						value5 = TL_SetColor(tlID, MediumImpact_Color);
					
					case 3:				// high
						value5 = Arw_SetColor(arrowID, HighImpact_Color);
						value5 = TL_SetColor(tlID, HighImpact_Color);
				
				end; //: ImpactOfEvent switch

				indexNumber	= indexNumber + 1;
				
				dtEconEvent = IFF(indexNumber > listLength, 9999999, EE.DateTimeOfEvent(NameOfList, indexNumber));
				
				Print(Spaces(3), "Next econ event = ", DateTimeToStr(dtEconEvent));
				
//				value2 = value2 + 1;
			
			end else if (IntPortion(barDT[x]) > IntPortion(dtEconEvent)) then begin 
			
				Print("BarDT: ", DateTimeToStr(BarDT[x]), " econ event: ", DateTimeToStr(dtEconEvent), " - happened on a market closed day");
				
				indexNumber	= indexNumber + 1;
				
				dtEconEvent = EE.DateTimeOfEvent(NameOfList, indexNumber);
			
//				value1 = value1 + 1;
			end;
	
		end; //: z loop
	end; //: x loop
	
//	Print("How many economic events missed? ", value1);
//	Print("How many economic events plotted? ", value2);

		loopDoneForBar = False;
		
		while (loopDoneForBar = False) begin 
		
			// If the economic event doesn't happen on this day -> skip
			// that way, when the market is closed when economic events happened, the list moves on
			if (IntPortion(barDT[x]) > IntPortion(dtEconEvent)) then begin 
			
				y = y + 1;
				
				Print(Spaces(2), "How many days skipped? ", NumToStr(y, 0));
				
				Print(Spaces(4), "Date: ", FormatDate("dd-MM-yyyy", barDT[x]), 
					"  event date: ", FormatDate("dd-MM-yyyy", dtEconEvent));
			
				indexNumber	= indexNumber + 1;
				
				if (indexNumber <= listLength) then begin
					dtEconEvent = EE.DateTimeOfEvent(NameOfList, indexNumber);
//					Print("indexnum: ", NumToStr(indexNumber, 0));
				end;
				
				loopDoneForBar = True;
						
			end else 
			
			if (barDT[x-1] < dtEconEvent) and (barDT[x+1] > dtEconEvent) then begin 
			
				z = z + 1;
							
				Print("How many events are there according to the code? ", NumToStr(z, 0), 
						"  And what is x? ", NumToStr(x, 0));
			
//				Print(Spaces(2), "dt: ", NumToStr(dtEconEvent, 10), " indexNumber: ", indexNumber,
//					" Date: ", FormatDate("dd-MM-yyyy", dtEconEvent), "  time: ", ToTime_DT(dtEconEvent));
				
				// Draw text & arrows
				textID = Text_New_s(EE.DateList(NameOfList, indexNumber), EE.TimeList(NameOfList, indexNumber) * 100, barPrice[x] + tickOffSet,
									Text(EE.EventList(NameOfList, indexNumber), "(", EE.RegionList(NameOfList, indexNumber), ")"));
				
				arrowID = Arw_New_s(EE.DateList(NameOfList, indexNumber), EE.TimeList(NameOfList, indexNumber),
				 					barPrice[x] + 0.33 * tickOffSet, True);				
			
				indexNumber	= indexNumber + 1;
				dtEconEvent = EE.DateTimeOfEvent(NameOfList, indexNumber);
				
				if (dtEconEvent = prevDtEconEvent) then 
					loopDoneForBar = False 
				else 
					loopDoneForBar = True;
				
			end else 
				loopDoneForBar = True;
		end;
		//prevDtEconEvent = dtEconEvent;
	
	

	
	Print("length of list? : ", EE.GetMaxIndex(NameOfList));

end; //: LastBarOnChart_s check

Started this thread Reply With Quote
The following user says Thank You to Jura for this post:
 
(login for full post details)
  #40 (permalink)
monexx
Nitra Slovakia
 
 
Posts: 3 since Feb 2014
Thanks: 2 given, 0 received



Jura View Post
See the code below, which highlights economic events with an arrow and text. It's not 'production ready' (and therefore not "officially" published), but should give you more than enough to start with:

 
Code
Inputs:
	NameOfList("myHistList"),
	RegionsToKeep("EUR;USD;GBP"),
	ChopUpStrings(False),
	Ticks_OffSet(8),
	HighImpact_Color(Red),
	MediumImpact_Color(yellow),
	LowImpact_Color(cyan),
	DisplayArrow(True),
	Arrow_Size(5),
	DisplayLine(True),
	Line_Width(1),
	Line_Style(2),
	DisplayText(True),
	Text_FontSize(10),				
	Text_FontName("Lucida Sans Typewriter"),
	Text_FontColor(white);

Variables:
	tickOffSet( Ticks_OffSet * MinMove), //(Power(10, Round(Log(PriceScale) / Log(10), 0)) / MinMove) ),
	tickSize(MinMove / PriceScale), 
	dtEconEvent(0), prevDtEconEvent(0), dtNextBar(0), dtPrevBar(0), indexNumber(1),
	firstDate(0), firstTime(0), arrowID(0), textID(0), tlID(0), loopDoneForBar(False), impactOfEvent(0),
	listLength(0),
	x(0), y(0), z(0);

if (CurrentBar = 1) then begin 
	 firstDate = Date;
	 firstTime = Time_s;
end;

Arrays:
	barPrice[](0), barDT[](0), barPriceLow[](0);

once cleardebug;

// Collect data
if (BarStatus(1) = 2) then begin 
	x = Array_GetMaxIndex(barPrice);
	
	Array_SetMaxIndex(barPrice, x + 1);
	Array_SetMaxIndex(barDT, x + 1);
	Array_SetMaxIndex(barPriceLow, x + 1);
	
	barPrice[x+1]  	= Highest(High, 10);  //High;
	
	if (x > 10) then 
		barPrice[x+1-10] 	= Highest(High, 20);
	
	barDT[x+1] 			= ELDateToDateTime(Date) + ELTimeToDateTime_s(Time_s);
	barPriceLow[x+1]	= Low - (MinMove * 2);
	
end; //: Data collection


if (LastBarOnChart_s = True) and (BarStatus(1) = 2) and (GetAppInfo(aiRealTimeCalc) = 0) then begin 

	// Generate economic events list
	once begin 
	
		value1 = EE.GetHistoricalEvents(NameOfList, firstDate, Date);
//		value1 = EE.GetFutureEvents(NameOfList);
		value1 = EE.KeepTimeRange(NameOfList, SessionStartTime(0, DayOfWeek(Date)), SessionEndTime(0, DayOfWeek(Date)));
		value1 = EE.KeepRegions(NameOfList, RegionsToKeep);			// Only keep the specified regions in the list
		value1 = EE.RemoveImpact(NameOfList, 0);							// Remove all events with impact 0 (i.e. bank holiday)
	
		// Note: uncomment the line below to see which Economic Events are in the list after the filtering functions. (For debugging purposes)
//		EE.PrintToOutputLog(NameOfList); 
	end;

	Print("Lengt of bar array: ", array_getmaxindex(barPrice), "  and barDt: ", array_getmaxindex(barDT));
	
	dtEconEvent 	= EE.DateTimeOfEvent(NameOfList, indexNumber);	
	listLength 		= EE.GetMaxIndex(NameOfList);
	
	z = 1;
	y = 1;
	value1 = 1;
	value2 = 1;
	
	// Loop through data
	for x = 1 to Array_GetMaxIndex(barDT) - 1 begin 
	
		// if there are multiple economic events on this time
		for z = 0 to 9 begin
		
			if (IntPortion(barDT[x]) = IntPortion(dtEconEvent)) and (barDT[x-1] < dtEconEvent) and (barDT[x+1] > dtEconEvent) then begin 
			
				Print("PrevBar: ", DateTimeToStr(barDT[x-1]), " Event: ", DateTimeToStr(dtEconEvent), "  next bar: ", DateTimeToStr(barDT[x+1]));
				Print(Spaces(2), "Date of event: ", FormatDate("dd-MM-yy", ELDateToDateTime(EE.DateList(NameOfList, indexNumber))),
						"  Time of event: ", FormatTime("HH:mm:ss", ELTimeToDateTime(EE.TimeList(NameOfList, indexnumber))),
						"  name of event: ", EE.EventList(NameOfList, indexNumber));
						
				// Plot
				if (z = 0) then begin 
					
					if (DisplayText = True) then
				
						textID = Text_New_s(EE.DateList(NameOfList, indexNumber), 
									EE.TimeList(NameOfList, indexNumber) * 100,
									barPrice[x] + (tickSize * 2) + Arrow_Size, 
									IffString(ChopUpStrings = True, 
										StrChopUp(Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")")),
										Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")")
									));
					
					if (DisplayArrow = True) then 
					
						arrowID = Arw_New_s(EE.DateList(NameOfList, indexNumber), 
													EE.TimeList(NameOfList, indexNumber) * 100,
													barPrice[x], True);
					
					if (DisplayLine = True) then 							
					 	tlID = TL_New_s(EE.DateList(NameOfList, indexNumber),
					 						EE.TimeList(nameOfList, indexNumber) * 100,
					 						barPriceLow[x],
					 						EE.DateList(NameOfList, indexNumber),
					 						EE.TimeList(nameOfList, indexNumber) * 100,
					 						barPriceLow[x] * 0.85);
					 		
			 									
				end //: z = 0
				
				else if (DisplayText = True) then
					value1 = Text_SetString(textID, Text(Text_GetString(textID), NewLine, "&", NewLine,
								IffString(ChopUpStrings = True,
									StrChopUp(Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")")),
									Text(EE.EventList(NameOfList, indexNumber), " (", EE.RegionList(NameOfList, indexNumber), ")"))	
								));
				
				// Formatting
				value6 = Text_SetSize(textID, Text_FontSize);
				value6 = Text_SetFontName(textID, Text_FontName);
				value6 = Text_SetStyle(textID, 0, 1);
				value6 = Text_SetColor(textID, Text_FontColor);
				
				value7 = Arw_SetSize(arrowID, Arrow_Size);
				
				value8 = TL_SetStyle(tlID, Line_Style);
				value8 = TL_SetSize(tlID, Line_Width);
				
				impactOfEvent = EE.ImpactList(NameOfList, indexNumber);
				
				switch (impactOfEvent) begin 
				
					case 1: 				// low impact
						value5 = Arw_SetColor(arrowID, LowImpact_Color);
						value5 = TL_SetColor(tlID, LowImpact_Color);
					
					case 2:				// medium
						value5 = Arw_SetColor(arrowID, MediumImpact_Color);
						value5 = TL_SetColor(tlID, MediumImpact_Color);
					
					case 3:				// high
						value5 = Arw_SetColor(arrowID, HighImpact_Color);
						value5 = TL_SetColor(tlID, HighImpact_Color);
				
				end; //: ImpactOfEvent switch

				indexNumber	= indexNumber + 1;
				
				dtEconEvent = IFF(indexNumber > listLength, 9999999, EE.DateTimeOfEvent(NameOfList, indexNumber));
				
				Print(Spaces(3), "Next econ event = ", DateTimeToStr(dtEconEvent));
				
//				value2 = value2 + 1;
			
			end else if (IntPortion(barDT[x]) > IntPortion(dtEconEvent)) then begin 
			
				Print("BarDT: ", DateTimeToStr(BarDT[x]), " econ event: ", DateTimeToStr(dtEconEvent), " - happened on a market closed day");
				
				indexNumber	= indexNumber + 1;
				
				dtEconEvent = EE.DateTimeOfEvent(NameOfList, indexNumber);
			
//				value1 = value1 + 1;
			end;
	
		end; //: z loop
	end; //: x loop
	
//	Print("How many economic events missed? ", value1);
//	Print("How many economic events plotted? ", value2);

		loopDoneForBar = False;
		
		while (loopDoneForBar = False) begin 
		
			// If the economic event doesn't happen on this day -> skip
			// that way, when the market is closed when economic events happened, the list moves on
			if (IntPortion(barDT[x]) > IntPortion(dtEconEvent)) then begin 
			
				y = y + 1;
				
				Print(Spaces(2), "How many days skipped? ", NumToStr(y, 0));
				
				Print(Spaces(4), "Date: ", FormatDate("dd-MM-yyyy", barDT[x]), 
					"  event date: ", FormatDate("dd-MM-yyyy", dtEconEvent));
			
				indexNumber	= indexNumber + 1;
				
				if (indexNumber <= listLength) then begin
					dtEconEvent = EE.DateTimeOfEvent(NameOfList, indexNumber);
//					Print("indexnum: ", NumToStr(indexNumber, 0));
				end;
				
				loopDoneForBar = True;
						
			end else 
			
			if (barDT[x-1] < dtEconEvent) and (barDT[x+1] > dtEconEvent) then begin 
			
				z = z + 1;
							
				Print("How many events are there according to the code? ", NumToStr(z, 0), 
						"  And what is x? ", NumToStr(x, 0));
			
//				Print(Spaces(2), "dt: ", NumToStr(dtEconEvent, 10), " indexNumber: ", indexNumber,
//					" Date: ", FormatDate("dd-MM-yyyy", dtEconEvent), "  time: ", ToTime_DT(dtEconEvent));
				
				// Draw text & arrows
				textID = Text_New_s(EE.DateList(NameOfList, indexNumber), EE.TimeList(NameOfList, indexNumber) * 100, barPrice[x] + tickOffSet,
									Text(EE.EventList(NameOfList, indexNumber), "(", EE.RegionList(NameOfList, indexNumber), ")"));
				
				arrowID = Arw_New_s(EE.DateList(NameOfList, indexNumber), EE.TimeList(NameOfList, indexNumber),
				 					barPrice[x] + 0.33 * tickOffSet, True);				
			
				indexNumber	= indexNumber + 1;
				dtEconEvent = EE.DateTimeOfEvent(NameOfList, indexNumber);
				
				if (dtEconEvent = prevDtEconEvent) then 
					loopDoneForBar = False 
				else 
					loopDoneForBar = True;
				
			end else 
				loopDoneForBar = True;
		end;
		//prevDtEconEvent = dtEconEvent;
	
	

	
	Print("length of list? : ", EE.GetMaxIndex(NameOfList));

end; //: LastBarOnChart_s check



Hello Jura
I compiled code in Multicharts but the chart does not show me anything.

Can you please advise where it can be wrong?

Reply With Quote


futures io Trading Community Platforms and Indicators MultiCharts > The Economic Events Collection for MultiCharts


Last Updated on May 2, 2016


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing

A Transparent Glimpse Into a Prop Traders Life w/Chris Gray @ Earn2Trade

Elite only
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 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