以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://222.73.7.161/bbs/index.asp) -- 高级功能研发区 (http://222.73.7.161/bbs/list.asp?boardid=5) ---- 建议开发c#作为自动交易语言 (http://222.73.7.161/bbs/dispbbs.asp?boardid=5&id=1595) |
-- 作者:guotie -- 发布时间:2010/5/7 13:31:18 -- 建议开发c#作为自动交易语言 国外先进的自动交易软件,openquant,quantdeveloper都是把c#作为交易语言,并且,技术指标全部用c#编写。 |
-- 作者:admin -- 发布时间:2010/5/7 14:34:01 -- 那样的话,用户直接就用VS2008的C#编写交易策略就行了,还用金字塔何干。 此外,金字塔也提供了基于C++的接口规范,你同样可以使用这些高级语言编写策略然后通过金字塔下单。 |
-- 作者:guotie -- 发布时间:2010/5/7 14:38:06 -- 要用到金字塔的交易测试,执行体系; mt还是用c、c++写的指标、交易体系呢 |
-- 作者:cyberfox2002 -- 发布时间:2010/5/15 20:21:52 -- 主流开发语言写策略,没有编程基础的人很难接受自动化交易,如果用简单的语言,那客户群体就大多了。 |
-- 作者:Likai -- 发布时间:2010/5/17 16:41:28 -- 可以通过C++插件接口,采用IPC技术,把接口封装成可以被C#调用的DLL。 |
-- 作者:winewine99 -- 发布时间:2010/6/19 19:44:45 -- 以下列OpenQuant代码为例,给讲讲封装过程,并在金字塔中调用怎么做 using OpenQuant.API; using OpenQuant.API.Indicators; using System.Drawing; public class MyStrategy : Strategy { // quantity to buy on a trade [Parameter("Order quantity (number of contracts to trade)")] double Qty = 100; [Parameter("Bar Block Size")] int BarBlockSize = 6; [Parameter("Length of SMA in blocks (weeks)", "SMA")] int FastSMALength = 22; [Parameter("Length of SMA in blocks (weeks)", "SMA")] int SlowSMALength = 55; int positionInBlock = 0; bool buyOnNewBlock; bool sellOnNewBlock; // two moving averages SMA fastSMA; SMA slowSMA; public override void OnStrategyStart() { // set up the fast average fastSMA = new SMA(Bars, FastSMALength * 7, Color.Yellow); Draw(fastSMA, 0); // set up the slow average slowSMA = new SMA(Bars, SlowSMALength * 7, Color.Pink); Draw(slowSMA, 0); } public override void OnBarOpen(Bar bar) { // calc quantity to reverse a position double orderQty = 2 * Qty; if (!HasPosition) orderQty = Qty; if (positionInBlock == 0) { if (buyOnNewBlock) { Buy(orderQty, "Reverse to Long"); buyOnNewBlock = false; } if (sellOnNewBlock) { Sell(orderQty, "Reverse to Short"); sellOnNewBlock = false; } } } public override void OnBar(Bar bar) { // if our SMAs contain the current bar date if (fastSMA.Contains(bar.DateTime) && slowSMA.Contains(bar.DateTime)) { // see which one is above the other Cross cross = fastSMA.Crosses(slowSMA, bar); if (cross == Cross.Above) buyOnNewBlock = true; if (cross == Cross.Below) sellOnNewBlock = true; } positionInBlock = (positionInBlock++) % BarBlockSize; } } |
-- 作者:winewine99 -- 发布时间:2010/6/19 19:50:15 -- [求助]跨窗格输出字符串,无效? using OpenQuant.API; using OpenQuant.API.Indicators; using System.Drawing; public class MyStrategy : Strategy { // quantity to buy on a trade [Parameter("Order quantity (number of contracts to trade)")] double Qty = 100; [Parameter("Bar Block Size")] int BarBlockSize = 6; [Parameter("Length of SMA in blocks (weeks)", "SMA")] int FastSMALength = 22; [Parameter("Length of SMA in blocks (weeks)", "SMA")] int SlowSMALength = 55; int positionInBlock = 0; bool buyOnNewBlock; bool sellOnNewBlock; // two moving averages SMA fastSMA; SMA slowSMA; public override void OnStrategyStart() { // set up the fast average fastSMA = new SMA(Bars, FastSMALength * 7, Color.Yellow); Draw(fastSMA, 0); // set up the slow average slowSMA = new SMA(Bars, SlowSMALength * 7, Color.Pink); Draw(slowSMA, 0); } public override void OnBarOpen(Bar bar) { // calc quantity to reverse a position double orderQty = 2 * Qty; if (!HasPosition) orderQty = Qty; if (positionInBlock == 0) { if (buyOnNewBlock) { Buy(orderQty, "Reverse to Long"); buyOnNewBlock = false; } if (sellOnNewBlock) { Sell(orderQty, "Reverse to Short"); sellOnNewBlock = false; } } } public override void OnBar(Bar bar) { // if our SMAs contain the current bar date if (fastSMA.Contains(bar.DateTime) && slowSMA.Contains(bar.DateTime)) { // see which one is above the other Cross cross = fastSMA.Crosses(slowSMA, bar); if (cross == Cross.Above) buyOnNewBlock = true; if (cross == Cross.Below) sellOnNewBlock = true; } positionInBlock = (positionInBlock++) % BarBlockSize; } } |
-- 作者:winewine99 -- 发布时间:2010/6/19 19:59:08 -- 或者如何做成控件并供vba调用? 或者如何做成控件并供vba调用? |
-- 作者:admin -- 发布时间:2010/6/19 20:24:21 -- C#编写ACTIVEX控件的知识,网上多得是,建议你到书店买书回去正规学习。 |
-- 作者:lxy-fxj -- 发布时间:2010/6/27 12:39:54 -- 相对于VB,对于大众化不讲,个人觉得lua脚本简单一些,金字塔有没有考虑过调用lua脚本公式 |