PureBytes Links
Trading Reference Links
|
Hi Peter, Thanks for your code. I have been able to get it work and it produces nice plot windows, however without data.
I did however found out that if I change my original code wOI=TimeFrameCompress(Foreign("OI_GBP","open",1),inWeekly); into wOI=TimeFrameCompress(Foreign("OI_GBP","open",2),inWeekly);
i will get the plots in my original solution.
I think it has something to do with the date I use for the COT data. I actually use the reporting date as the date in the record (so this would be Tuesday). I think if I go to weekly resolution it then it may not work if I do not fill holes...
Though it works for now, I am not happy with the solution. Would you mind sharing me how you have stored the COT data in AB?
Again, many thanks! Michel
--- In amibroker@xxxxxxxxxxxxxxx, "Peter" <aretep@xxx> wrote: > > > Hi > > I import COT data but in a different way to you but this how I plot the > COT data > > > > Assuming the chart that you are looking at is GBPUSD and the COT OI > ticker is called OI_GBP and you want to plot the OI separately > > then create function file called \# include COT Symbol.afl as below > which when ticker == "GBPUSD" stores `GBP' in the global > variable includeCotTicker > > > > > function includeCOTsymbol(ticker) > > { > > global includeCotTicker; > > includeCotTicker = WriteIf(ticker == "GBPUSD" ,"GBP"); > > } > > > > > To plot the OI use the code below. You need to change the folder address > to where you store the function file > > > > // Plot Foreign Ticker > > > #include "C:\Program Files\AmiBroker\Formulas\# include\# include COT > Symbol.afl"; > > > > includeCOTsymbol(Name()); > > // This calls function "includeCOTsymbol()" in file "# include COT > Symbol.afl" and sends the ticker "name()",then sets the ticker to the > global variable "includeCotTicker " > > > > // This uses the Global Variable 'includeCotTicker' which is set in # > include.afl > > Ticker = "OI_ " + includeCotTicker "; > > SetForeign(ticker); > > TickerName = FullName(); > > ForeignOpen = O; > > ForeignHigh = H; > > ForeignLow = L; > > ForeignClose = C; > > ForeignInterval = Interval(2); > > ForeignDate = Date(); > > RestorePriceArrays(); > > > > Color = ParamColor("Color", colorDarkBlue); > > > > PlotForeign( Ticker, "", ParamColor("Color", colorDarkBlue), > ParamStyle("Style", styleLine, maskAll) ); > > GraphXSpace=10; > > > > _N( Title = EncodeColor(colorRed) + tickername + " " + ticker + > EncodeColor(colorDarkBlue) + " " + ForeignInterval + " " + > ForeignDate + " " + StrFormat(" Close %g", ForeignClose )); > > > > The end result would be a window with a chart for GBPUSD and separate > chart for OI_GBP. > > > > > > You will have to add extra includeCotTicker = WriteIf(ticker == "GBPUSD" > ,"GBP"); lines for different tickers and have a different plot file > for each COT indicator i.e. Commercial Net. > > > > As you change the main ticker i.e. say to USDYEN then the appropriate > COT chart will also change. > > > > Hope this helps > > Peter > > --- In amibroker@xxxxxxxxxxxxxxx, "goedings" goedings@ wrote: > > > > Hi, I have read Larry Williams book on COT and its application to > > trading. I have downloaded the historical data and have it all in one > > MS Access db. Now I want the data in AB and construct the indicators. > > > > I have been able to get the data in AB: I have exported key fields per > > ticker to ASCI and imported them in AB as a new symbol basically > > mapping those fields to standard o/h/l/c fields. In the ASCI wizard I > > have ticked the non-quotes, allow for neg pricing etc. > > > > The mapping is: > > High -> Open interest > > Open -> Nett Commercials > > Low -> Nett Traders > > Close -> Nett Public > > > > From the dataview for the new created ticker I see the data there. So > > I have e.g. a ticker called "OI_GBP" which contains the key > > OpenInterest data fields for British Pound. > > > > Now come the difficulties. If I have GBPUSD as active symbol and > > create a new indcator that acesses via Foreign() the ticker with COT > > data ("OI_GBP") it won't plot the required fields. It seems that it > > will only plot the values in the "close" field of ("OI_GBP"). > > > > Probably this is caused by the foreign() function: > > wOI=TimeFrameCompress(Foreign("OI_GBP","open",1),inWeekly); > > > > It should plot nett commercials but it plots the nett public.... > > > > Anyone? > > >
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
__,_._,___
|