Cone8
 ( 4.98% )
- ago
IB requires details to identify a contract symbol. Although we have a way to parse a symbol string to get this info, it would be more straightforward to enter these items in the Symbol manager:

1. Instrument Type (STK, FUT, OPT, etc.)
2. Exchange traded (SMART, NYMEX, etc.)
3. Currency string - (USD, EUR, CHF, etc.) Alternatively, this could be obtained from the Market and will be required for Multi-currency anyway.
4. Point Value - already exists for the contract "multiplier"
9
1,492
17 Replies

Reply

Bookmark

Sort
- ago
#1
Collective2 requires similar information. So the Collective2 broker adapter could benefit from such an improvement also.
0
- ago
#2
QUOTE:
2. Exchange traded (SMART, NYMEX, etc.)

Be sure to include ETFs as well. I tried looking up SMART, NYMEX, but the Fidelity quotes page can't find them, so they may not be ETFs. I'm not sure what they are.
0
- ago
#3
This #FeatureRequest is marked as available with Build 45 but I couldn't find any hints...

How is this implemented?
0
Cone8
 ( 4.98% )
- ago
#4
About 90% of this particular request was resolved in the IB Provider's Build 16, but it could be re-entered with other specifications for more general use.

For example, while working on the futures products, I discovered that many instruments trade different hours on the same exchange. There's no way to specify that currently.

Although it's generally easy to tell the type by the symbol, there's no distinction between Stocks and Indices, for example.
0
- ago
#5
The Collective2 Broker Adapter (finantic.WLC2) needs to know the "Instrument Type".

If this was available from "Markets and Symbols" it would make things more friendly.
1
Cone8
 ( 4.98% )
- ago
#6
Perhaps we closed this too hastily. Let's summarize what's needed to be incorporated in Markets & Symbols

1. Enumerated symbol type
e.g. enum { Stock, ETF, Index, Fund, Future, Option, Forex, Crypto, Bond, SSF, CFD }

2. Currency (3-letter string)
e.g. "USD", "EUR", "CAD", "AUD", "GBP", etc.

3. Symbol-specific market hours
An override to the exchange's default market hours when an instrument's market hours are different.

To accomodate this additions, four extra fields could be added to the symbol record, example:

Existing:
ZN###,Globex,1000,2500,0.015625,6,0

Proposed:
ZN###,Globex,1000,2500,0.015625,6,0,Future,USD,08:30-16:00,17:00-16:00
where the first set of times are the liquid/regular hours and the second are the total trading hours.
1
- ago
#7
QUOTE:
1. Enumerated symbol type
e.g. enum { Stock, ETF, Index, Fund, Future, Option, Forex, Crypto, Bond, SSF, CFD }

I would like to make this item a feature request. I don't care about items# 2 and 3.
1
- ago
#8
Don't forget this related feature request:
https://www.wealth-lab.com/Discussion/Markets-Display-Stop-Limit-Decimals-by-Price-Range-5987
0
- ago
#9
Could you please move this #FeatureRequest back to the Wishlist?
0
- ago
#10
Exposing superfluous properties can come at a cost so we have to be selective. Since @Cone has already done 90% of this work for IB which captures the major audience we need to be careful in moving forward.

We need to rethink this request, probably group it with the other one (#5987) and decide what requested features are essential and what do not have to go into the main client.
0
Cone8
 ( 4.98% )
- ago
#11
We can think about it while its activated. I'll do it.
1
- ago
#13
I'd like to be able to get symbol type, but I couldn't find anything in help. The code below produced this error.

QUOTE:
Initialize Exception (CRM) Line 15 - Object reference not set to an instance of an object.
at WealthScript1.MyStrategy.Initialize(BarHistory bars) in :line 15
at WealthLab.Backtest.UserStrategyExecutor.PrintProcess(List`1 symbols)


This is the code I'm trying. in B51 (functionality released B47)...

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Drawing; using System.Collections.Generic; namespace WealthScript1 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          if (bars.SymbolInfo.SecurityType == SecurityTypes.Fund)          {             ChartDisplaySettings cds = new ChartDisplaySettings();             cds.ShowVolumePane = false;             SetChartDrawingOptions(cds);          } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below } }


What am I doing wrong?
0
Glitch8
 ( 10.62% )
- ago
#14
Not every symbol will have a SymbolInfo attached to it. In fact, unless a specific Data Provider assigns them, they'll only appear if you define symbols yourself using the Markets and Symbols tool.

However, all symbols should have access to a Market. And with a Market, you can look at it's SecurityType to get the default security type of the market.

So it becomes:

if (bars.Market.SecurityType == SecurityTypes.Fund)
1
- ago
#15
Thanks, that got by the error, but the SecurityType seems to be off. This is my test dataset: AAPL ETH-USD FCNTX SPY. I get the following result:
QUOTE:
---Symbol by Symbol Debug Logs---
---FCNTX---
Security Type: Stock
---AAPL---
Security Type: Stock
---SPY---
Security Type: Stock
---ETH-USD---
Security Type: Crypto


Code:
CODE:
public override void Initialize(BarHistory bars) {          WriteToDebugLog(string.Concat("Security Type: ", bars.Market.SecurityType.ToString())); }


Chart tab shows APPL and SPY are from Wealth-Data; FCNTX (fund) and ETH-USD are from Yahoo-Finance. FCNTX (fund) and SPY (etf) are providing the wrong security type.
0
Glitch8
 ( 10.62% )
- ago
#16
Yes, we have some work to do to correctly assign all of these security types in the various providers. We just added the concept a few builds ago and haven't gotten them all assigned yet.
0
- ago
#17
Okay. I saw this complete in the wish list, so I thought I'd try implementing it. No problem.
0

Reply

Bookmark

Sort