[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Coding an indicator of two dynamic symbols



PureBytes Links

Trading Reference Links

Gary,

I'm not sure this is exactly what you are looking for but it just 
might give you an idea on how to work the rest out.

Assume the underlying futures has a symbol of XXX.

Place the COT data into a synthetic symbol named ~XXX

Use the Foreign function in the following manner:
YourVariable = Foreign("~"+Name(),"Open");
YourVariable2 = Foreign("~"+Name(),"High");
Repeat for all the data fields.


Now when you select XXX in the workspace, you will  have an 
automatic reference to the COT data associated with that
symbol.  Create your indicator in IB and use whatever type
of plot(s) you wish.

Hope this helps.

Regards,

Tony  


--- In amibroker@xxxxxxxxxxxxxxx, "Gary Serkhoshian" 
<serkhoshian777@xxxx> wrote:
> Hello all,
> 
> I am trying to code a simple indicator in theory, but being new to 
> AFL I'm stuck.
> 
> I am importing an ASCII file of Commitments of Traders (COT) Data 
> into AmiBroker.  As COT data has six components, I have "placed" 
them 
> as follows:
> 
>                         O:	Large Non-Commercial LONGS
> 			H:	Large Non-Commercial SHORTS
> 			L:	Commercial LONGS
> 		  	C:	Commerical SHORTS
> 			V:	Other LONGS
> 			OI:	Other SHORTS
> 
> I'd like to have a indicator that would plot the C of the 
underlying 
> futures contract, and the six other plots of the O,H,L,C,V,OI 
fields 
> of the COT data.  
> 
> In Tradestation Easylanguage code this would be Data1 and Data2 
which 
> would be generic.  The Foreign function is the closest I can find, 
> but it is symbol specific which means I would need to create 19 
> separate COT indicators to plot each contract I follow.  Is there a 
> way to make Foreign generic so that it reads Data1 and Data2?
> 
> Thanks,
> Gary


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/