Extracting Foreign Sym Data From Different Timeframe

Hi,

I am facing some difficulty in extracting Foreign Sym data (EOD data ) to my Intraday Chart. If someone can guide me where am I going wrong, it would be helpful.

Below Image Shows the EOD data stored for my Foreign Symbol (Synthetic Sym basically holding extra data in OI and AUX2 fields)

The data in OI field in above image is basically a date stored in Datenum format as defined by Amibroker. Now I am trying to fetch this data in my intraday chart. However I am not able to get the data.

Below is what I have tried so far. Please suggest where am I going wrong.

	SetForeign("RelevantExp_Gap_" + Name());	
	TimeFrameSet(inDaily);	
	relvExp = OI;	
	TimeFrameRestore();	
	RestorePriceArrays();
	relvExpExpanded = TimeFrameExpand( relvExp,inDaily);
	ReqDate = Lookup(relvExpExpanded,LastVisibleValue( DateTime() ),-1);
	ReqDate1 = DateTimeToStr(DateTimeConvert(2,ReqDate),4);
	_TRACE("FSym => " + "RelevantExp_Gap_" + Name()  + " | ReqDate => " + ReqDate + " | ReqDate1 => " + ReqDate1 + " | relvExpExpanded => " + relvExpExpanded + " | " );
	

Above code shows below in Trace Output Window

I want to get the data stored in the Foreign Symbol's OI field (EOD data) for the date which is same as my chart's last visible bar's date, in "yyyyMMdd" format for further usage. But when the last visible intraday data is that of 8th July, 2024, The trace output is not what I desire. Please suggest where is my code wrong.

Thanks,
Nandy

If someone can please point out the issue in my above code / show how the code should be, that would be very helpful for me. I am stuck and need to solve this issue to proceed further.

As far as I know , TimeFrameSet will not access your EOD data, when using intraday data.
Try creating the foreign symbol also as intraday data

Dear awilson,

Thank you so much for sharing this. I tried using intraday data. Although got some issues with handing Aux2 field, but finally could sort that out. Thanks again for your time.

Thanks,
Nandy

Before anything else, mixing SetForeign and TimeFrameSet is allowed ONLY IN ONE CASE, specifically explained here:

And that is not true that you can't access EOD data - you can. You might need to turn off "mixed intraday/eod data" in the Database Settings/Intraday Settings

Thanks Tomasz for your input. I realized the issue with mixing timeframe only after giving some try and failing ... But anyway, its much clearer now .

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.