GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Rework liquidity provider & country code to generic Market class, com… · nuswgg/Lean@26e8cf4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Algorithm.Python
    • PythonAlgorithm.cs
  • Algorithm.VisualBasic
    • QuantConnect.Algorithm.VisualBasic.vbproj
  • AlgorithmFactory
    • Loader.cs
  • Common
    • Data
      • Market
        • Tick.cs
        • TradeBar.cs
      • SubscriptionDataConfig.cs
      • SubscriptionManager.cs
    • Global.cs
    • Market.cs
    • QuantConnect.csproj
  • Engine/DataFeeds
    • Auxiliary
      • FactorFile.cs
      • FactorFileRow.cs
      • MapFile.cs
      • MapFileRow.cs
    • SubscriptionDataReader.cs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Algorithm.Python/PythonAlgorithm.cs‎

Copy file name to clipboardExpand all lines: Algorithm.Python/PythonAlgorithm.cs
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public override void Initialize()
3737
PythonEngine.Initialize();
3838
_gs = PythonEngine.AcquireLock();
3939

40-
const string s = @"../../../../tests";
41-
Type RTClass = typeof(Runtime.Runtime);
40+
//const string s = @"../../../../tests";
41+
//Type RTClass = typeof(Runtime.Runtime);
4242

43-
/* pyStrPtr = PyString_FromString(s); */
44-
MethodInfo PyString_FromString = RTClass.GetMethod("PyString_FromString", BindingFlags.NonPublic | BindingFlags.Static);
45-
object[] funcArgs = new object[1];
46-
funcArgs[0] = s;
47-
IntPtr pyStrPtr = (IntPtr)PyString_FromString.Invoke(null, funcArgs);
43+
///* pyStrPtr = PyString_FromString(s); */
44+
//MethodInfo PyString_FromString = RTClass.GetMethod("PyString_FromString", BindingFlags.NonPublic | BindingFlags.Static);
45+
//object[] funcArgs = new object[1];
46+
//funcArgs[0] = s;
47+
//IntPtr pyStrPtr = (IntPtr)PyString_FromString.Invoke(null, funcArgs);
4848

4949
}
5050

Collapse file

‎Algorithm.VisualBasic/QuantConnect.Algorithm.VisualBasic.vbproj‎

Copy file name to clipboardExpand all lines: Algorithm.VisualBasic/QuantConnect.Algorithm.VisualBasic.vbproj
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
<Name>QuantConnect.Interfaces</Name>
9090
</ProjectReference>
9191
</ItemGroup>
92+
<ItemGroup>
93+
<Folder Include="My Project\" />
94+
</ItemGroup>
9295
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
9396
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9497
Other similar extension points exist, see Microsoft.Common.targets.
Collapse file

‎AlgorithmFactory/Loader.cs‎

Copy file name to clipboardExpand all lines: AlgorithmFactory/Loader.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public bool TryCreateAlgorithmInstance(string assemblyPath, out IAlgorithm algor
164164

165165
//Get the list of extention classes in the library:
166166
var types = GetExtendedTypeNames(assembly);
167-
Log.Trace("Loader.CreateInstance(): Assembly types: " + string.Join(",", types));
167+
Log.Debug("Loader.CreateInstance(): Assembly types: " + string.Join(",", types));
168168

169169
//No extensions, nothing to load.
170170
if (types.Count == 0)
Collapse file

‎Common/Data/Market/Tick.cs‎

Copy file name to clipboardExpand all lines: Common/Data/Market/Tick.cs
+3-17Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -285,26 +285,12 @@ public override SubscriptionDataSource GetSource(SubscriptionDataConfig config,
285285
string source;
286286
var symbol = string.IsNullOrEmpty(config.MappedSymbol) ? config.Symbol : config.MappedSymbol;
287287
var securityType = config.SecurityType.ToString().ToLower();
288-
var countryCode = config.Country.ToString().ToLower();
288+
var market = config.Market.ToLower();
289289
var resolution = config.Resolution.ToString().ToLower();
290290
var file = date.ToString(dateFormat) + "_" + dataType.ToString().ToLower() + ".zip";
291291

292-
if (config.SecurityType == SecurityType.Equity)
293-
{
294-
//Add in the country code for equities for internationalization support.
295-
source = Path.Combine(Constants.DataFolder, securityType, countryCode, resolution, symbol.ToLower(), file);
296-
}
297-
else if (config.SecurityType == SecurityType.Forex || config.SecurityType == SecurityType.Cfd)
298-
{
299-
//FX, CFD's are brokerage/liquidity provider specific (eg. different brokerages have different spreads).
300-
var dataSource = config.LiquiditySource.ToString().ToLower();
301-
source = Path.Combine(Constants.DataFolder, securityType, dataSource, resolution, symbol.ToLower(), file);
302-
}
303-
else
304-
{
305-
//All other asset types default here
306-
source = Path.Combine(Constants.DataFolder, securityType, resolution, symbol.ToLower(), file);
307-
}
292+
//Add in the market for equities/cfd/forex for internationalization support.
293+
source = Path.Combine(Constants.DataFolder, securityType, market, resolution, symbol.ToLower(), file);
308294

309295
return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile);
310296
}
Collapse file

‎Common/Data/Market/TradeBar.cs‎

Copy file name to clipboardExpand all lines: Common/Data/Market/TradeBar.cs
+2-11Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ public override SubscriptionDataSource GetSource(SubscriptionDataConfig config,
333333
var securityTypePath = config.SecurityType.ToString().ToLower();
334334
var resolutionPath = config.Resolution.ToString().ToLower();
335335
var symbolPath = (string.IsNullOrEmpty(config.MappedSymbol) ? config.Symbol : config.MappedSymbol).ToLower();
336-
var countryCode = config.Country.ToString().ToLower();
337-
var liquiditySource = config.LiquiditySource.ToString().ToLower();
336+
var market = config.Market.ToLower();
338337
var filename = date.ToString(dateFormat) + "_" + dataType.ToString().ToLower() + ".zip";
339338

340339

@@ -345,15 +344,7 @@ public override SubscriptionDataSource GetSource(SubscriptionDataConfig config,
345344
symbolPath = string.Empty;
346345
}
347346

348-
if (config.Country == CountryCode.None)
349-
{
350-
//No country are international or brokerage specific liquidity providers with certain spreads.
351-
source = Path.Combine(Constants.DataFolder, securityTypePath, liquiditySource, resolutionPath, symbolPath, filename);
352-
}
353-
else
354-
{
355-
source = Path.Combine(Constants.DataFolder, securityTypePath, countryCode, resolutionPath, symbolPath, filename);
356-
}
347+
source = Path.Combine(Constants.DataFolder, securityTypePath, market, resolutionPath, symbolPath, filename);
357348

358349
return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile);
359350
}
Collapse file

‎Common/Data/SubscriptionDataConfig.cs‎

Copy file name to clipboardExpand all lines: Common/Data/SubscriptionDataConfig.cs
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,9 @@ public class SubscriptionDataConfig
103103
public string MappedSymbol;
104104

105105
/// <summary>
106-
/// Country code for the subscription
106+
/// Set the market / scope of the symbol
107107
/// </summary>
108-
public CountryCode Country = CountryCode.None;
109-
110-
/// <summary>
111-
/// The liquidity provider source for the data.
112-
/// </summary>
113-
public LiquidityProviderDataSource LiquiditySource = LiquidityProviderDataSource.NotApplicable;
108+
public string Market;
114109

115110
/// <summary>
116111
/// Consolidators that are registred with this subscription
Collapse file

‎Common/Data/SubscriptionManager.cs‎

Copy file name to clipboardExpand all lines: Common/Data/SubscriptionManager.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ public SubscriptionDataConfig Add(Type dataType, SecurityType security, string s
9393
{
9494
case SecurityType.Forex:
9595
//Currently QC FX data source is FXCM pricing.
96-
newConfig.LiquiditySource = LiquidityProviderDataSource.FXCM;
96+
newConfig.Market = QuantConnect.Market.FXCM;
9797
break;
9898
case SecurityType.Equity:
9999
//Currently QC Equities are US Only.
100-
newConfig.Country = CountryCode.USA;
100+
newConfig.Market = QuantConnect.Market.USA;
101101
break;
102102
}
103103

Collapse file

‎Common/Global.cs‎

Copy file name to clipboardExpand all lines: Common/Global.cs
-58Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -322,64 +322,6 @@ public enum Resolution
322322
Daily
323323
}
324324

325-
/// <summary>
326-
/// Country codes for data grouping to support internationalization
327-
/// </summary>
328-
public enum CountryCode
329-
{
330-
/// No country / global.
331-
None,
332-
/// United States
333-
USA,
334-
/// United Kingdom
335-
GBR,
336-
/// Japan
337-
JPN,
338-
/// Germany
339-
DEU,
340-
/// China
341-
CHN,
342-
/// India
343-
IND,
344-
/// Brazil
345-
BRA,
346-
/// Australia
347-
AUS,
348-
/// Switzerland
349-
CHE,
350-
/// Hong Kong
351-
HKG,
352-
/// Canada
353-
CAN,
354-
/// France
355-
FRA,
356-
/// Spain
357-
ESP,
358-
/// Mexico
359-
MEX,
360-
/// Korea
361-
KOR,
362-
/// South Africa
363-
ZAF,
364-
/// Taiwan
365-
TWN
366-
}
367-
368-
369-
/// <summary>
370-
/// Data source for data which is liquidity provider specific, such as CFD or Forex.
371-
/// </summary>
372-
public enum LiquidityProviderDataSource
373-
{
374-
/// Liquidity is exchange driven and not brokerage specific.
375-
NotApplicable,
376-
377-
/// FXCM Supplies Lean Forex Data
378-
FXCM,
379-
380-
/// Oanda supplies Lean Forex and Cfd Data
381-
Oanda
382-
}
383325

384326
/// <summary>
385327
/// Wrapper for algorithm status enum to include the charting subscription.
Collapse file

‎Common/Market.cs‎

Copy file name to clipboard
+38Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3+
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
namespace QuantConnect
16+
{
17+
/// <summary>
18+
/// Markets Collection: Soon to be expanded to a collection of items specifying the market hour, timezones and country codes.
19+
/// </summary>
20+
public static class Market
21+
{
22+
/// <summary>
23+
/// USA Market
24+
/// </summary>
25+
public static string USA = "usa";
26+
27+
/// <summary>
28+
/// Oanda Market
29+
/// </summary>
30+
public static string Oanda = "oanda";
31+
32+
/// <summary>
33+
/// FXCM Market Hours
34+
/// </summary>
35+
public static string FXCM = "fxcm";
36+
37+
}
38+
}
Collapse file

‎Common/QuantConnect.csproj‎

Copy file name to clipboardExpand all lines: Common/QuantConnect.csproj
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
<Compile Include="Data\Market\Splits.cs" />
133133
<Compile Include="Data\SubscriptionDataSource.cs" />
134134
<Compile Include="Field.cs" />
135+
<Compile Include="Market.cs" />
135136
<Compile Include="Notifications\Notification.cs" />
136137
<Compile Include="Notifications\NotificationManager.cs" />
137138
<Compile Include="Orders\MarketOnCloseOrder.cs" />

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.