Access PointValue for futures on CSI

Hi, I'm using CSI data for multiple futures contracts. What I need to access is the point value for each contract, which is accesible via their website (can also provide a .csv file for it) here.

The idea is to code position sizing according to each contract's ATR and PointValue for almos 100 futures contracts.

Thanks in advance,

EZ

Consider a data provider like Norgate, which provides point values, margin deposit, and tick size.
Plus, the contracts are grouped for you in Symbols as separate markets.
Real time saver. :hourglass_flowing_sand:

1 Like

Using ASCII import you can add non-quotation data to Amibroker. Here is a link Import from ASCII file.

I'll try to look up the sample file in my archives.

1 Like

This is the file content -

Ticker,FullName,Market,Group,Margin,PointValue,TickSize,RoundLotSize
GC2,Gold 100-oz / GC,0,0,6600,100,0.1,1
HG2,High Grade Copper / HG,0,0,3000,250,0.05,1
PA2,Palladium / PA,2,0,28100,100,0.1,1
PL2,Platinum / PL,2,0,2800,50,0.1,1
SI2,Silver 5000-oz / SI,0,0,6600,50,0.5,1
AC,Ethanol / EH,1,1,2400,29000,0.001,1
CL2,Crude Oil / CL,2,1,3900,1000,0.01,1
HO2,Heating Oil / HO,2,1,4600,42000,0.0001,1

IIRC this file was imported using Import Wizard with No Quotation Data marked.

2 Likes

Not sure of your complete working process but what you can do is in your ASCII file that you export from CSI you can also export the point value. Now using the import wizard you can create an import procedure to import the exported file. You can add the point value to an aux field.

You only have to set that up once, you can then use it for all your futures including new futures.

You can also accomplish the same in other ways, like import separate files etc but if it can all be done from 1 file... probably just as easy.

Make sure to select the point file as an export field.

Knipsel

PS: Since this is your first post, welcome to Amibroker and welcome to the Forum

2 Likes

Tks for the idea. I'm already using Norgate for stocks and its great. The limitation on futures however is the scope of markets included ~100, vs. CSI. Also, the way the backward adjustment is made inside Norgate, which is plain vanilla and for most markets it works, but for some I really appreciate the flexibility that comes with CSI.

1 Like

great info, will definitely try it out. Is there a way to call the aux field from AFL?

Amibroker rocks! its the best backtester we've tried. Still some way to go to fully understand it!

tks

Guess you allready found the way to call the aux field :wink:

Henri, how would the ASCII imported data setup work in terms of PnL? I mean, the Point Value via the Aux 1 data works for position sizing, bet then again, when backtesting on multiple contracts, how would the pnl be translated into corresponding dollars and not jus a points backtest?

I honestly have no idea, never done it myself.

Maybe you can multiply the futures price with the aux price in your strategy to get to where you want to get ?

If you look at the link ab-trader gave you, if you go to that website, you will see there is actualy a field in the database called "POINTVALUE". It's very likely that if you import the pointvalue in the correct field, your problems will be "solved" and you have a much nicer solution.

It will introduce other "problems".... first that can think of is that I know CSI will use different symbol names depending on the backadjustment.... If you for example export 7 different contracts for the same symbol, they would all need the same pointvalue. You could use the cdbfacts.adm file that is stored in the UA\archives\ directory. That is the same file that you see on the CSI website....

Do you export multiple futures contracts or just a single one per future ?

Probably that is the best way to go.... Make sure that from the cdbfacts file you create a file that looks like the file ab-trader created and you import that.

Not sure how good you are with stuff like that but if you want I can help out. Should be possible to import all 20.000 :slight_smile:

Once again, many thanks! I'll give it a go and get back to you if I get lost in the way!

The approach I referred to set PointValue as a property of a future contract. Then, if Futures Mode is selected, Amibroker calculates PnL based on this data without any additional efforts from tge developer side.

1 Like

understood, many thanks!

@ab-trader

Did you create that file manualy ?

I used python to transform the file from my data provider (Premium Data) to Amibroker format. Since I was using continuous contract it was only 40 or 50 of them.

Thanks for the explanation. Was hoping it was some CSI file that I missed :slight_smile: Probably for most users using Excel or simular will be the easiest solution.

If the source file is a table and only several columns need to be shuffled and sorted to meet Amibroker format, than Excel or Google sheets can be used as well. It depends on the developer skills more than on the tools.

Yes. Most "simple" users like me will not have enough python skill but it should not be a problem with any of those tools.

I will show you how the data from CSI looks:

1,IB,CBT,Broilers-Iced (INACT)-CBT,2,cents/lb,30000 lbs,$3.00,VVVVVVVVVVVV,,1,,,,,,USD,19690819,,,,,,,,,,,,,Fut,,,,,,,,,,,,,,,,,,,,,,,,,28,IcedBroiler,30000,,,,,1,,,,,,,,,,1,,19690819,19690819,,,,,Food & Fiber,S
2,LC,CME,Live Cattle (combined)-CME,2,cents/lb,40000 lbs,$4.00,SVSVSVSVIVSV,,2.5,,,,*1,,USD,19641130,USME,2,2,,20180801,19841030,,,,,,,Fut,,,,,,,,,,,,,,,,,,,,,,,,,61710,LvCattlF+E,40000,,,,08:30 to 13:05,2.5,,202104,20210430,202106,20210630,202108,20210831,202110,20211029,,,19641130,19660209,694,L2,,109.7,Livestock & Meats,S
3,CC,ICE-US,Cocoa (RTH),0,USD/tonne,10 tonnes,$10.00,IIVIVIVIVIIV,,1,,,,*1,,USD,19651230,WD|CC,1,0,,,19860313,,,,,,,Fut,,,,,,,,,,,,,,,,,,,,,,,,,37954,Cocoa,10,,,,04:45 to 13:30,1,,202103,20210316,202105,20210513,202107,20210715,202109,20210915,,,19651230,19651230,,CC,,,Food & Fiber,S

These are 3 lines, for 3 futures, Broilers, Live Cattle and Cocao.

All the information, like point value, is there but no header or anything. Also, when exporting data from CSI's software, it will name the file according to the backtesting rules. All in all the resulting exported data can have atleast 10 different names...

LC could for example be LC_N, LC_B LC_P LC_G for different kind of continuous series. Other naming conventions could be LC__00X1N or LC__00X2N for the nearest and second nearest contract.

So if anyone ever bumps into this thread, you can use excel (or simular) to extract the information from cdbfacts.adm and then make a column next to the symbol column, in that column you add the contract information.

So it would look like this:

symbol column contract info
LC __00X1N

Excel will have a function to combine 2 columns. It can then all be saved as CSV and imported into Amibroker.

Henri seems that we trade some quite similar assets. What platform do you use for actual trading?