交易开拓者对多周期交易的问题
1、在不同时间周期上交易同一个品种
http://www.tradeblazer.net/forum/thread-1348-1-44.html
假定我有两个程序,程序A以半小时周期交易品种X;程序B以5分钟周期交易品种X;这两个程序能同时运行吗?
假定可以同时运行,有没有一种机制能够使这个两个程序间可以交换信息?我不清楚TB对硬盘文件读写支持到什么程度。这两个程序是否可以通过对硬盘文件操作的办法进行信息传递或信息共享?
现在不支持这样的功能,以后可以考虑支持文件读写的功能。 |
回复 #4 tradeblazer 的帖子
我觉得开拓者应该站得更高,跳出在K线图中做文章的框框,做基于“数据”的系统,而不是基于单一“K线图”的系统。这里的“数据”包括不同时间周期,不同市场的数据。这样,开拓者面对的是整个“投资组合”,而不是一部分。 |
2、【交易规模】使用多重系统时如何进行头寸管理
http://www.tradeblazer.net/forum/thread-3994-1-28.html
Managing Positions When Using Multiple Systems 使用多重系统时如何进行头寸管理 In our last Bulletin we presented our reasoning for using multiple systems in multiple markets in order to produce more consistent profits and to generate a smoother equity curve. In this Bulletin we will address some of the practical aspects of controlling our position sizes when employing this strategy. 在上一贴中我们解释了在多重市场中使用多重系统,有助于获得持续一致的盈利和更为平滑的资金曲线。在本帖中,我们将给出在实践中使用这种策略时会碰到的一些有关控制头寸规模的问题。 When using multiple strategies/systems in one market we are inevitably faced with the question of how many positions to trade and what to do when long and short trades appear at the same time. Many potential problems can be reduced if the systems are designed to integrate well so that one type of system will be turning off just as a different type of system is turning on. It is certainly not that difficult to devise rules that will serve to eliminate most of the contradictory trading signals. 我们要建立多少头寸?当多头信号和空头信号同时出现时我们该如何建立头寸方向?等等这些问题是我们在同一市场中使用多重策略/系统时必然要面对的问题。其中一些问题是可以避免的,只要能协调好系统间的关系,当一种系统被触发时与之相反的系统就会自动关闭。我们不难通过建立一些规则来排除大部分相互矛盾的交易信号。 For example we can require that prices be above a specified moving average in order to initiate buy signals and below that same moving average to generate signals to sell short. Although such a rule might appear to avoid contradictory signals it is not foolproof. It is possible that an existing long position initiated at prices above the specified moving average might still be in place when a new entry is signalled in the opposite direction as a result of prices having drifted below the moving average. In this instance we have an open long position and a new signal to sell short. 例如,在产生买入信号前我们要求价格必须在某一移动平均线之上,在产生卖空信号前我们要求价格必须在某一移动平均线之下。尽管这样的规则能避免产生一些相互矛盾的信号,但不能完全避免。比如当价格低于某一移动平均线时系统发出卖空信号,然而此时我们还持有在价格高于该移动平均线时建立的多头仓位,也就是说在我们持有多头仓位的时候又接到一个卖空的入场信号,这种相互矛盾的情形是有可能出现的。 Although it is theoretically possible to have two or more accounts and hold both long and short positions at the same time, the common solution is to simply trade the net position. Two longs and a short is a net position of one long. A long and a short is a net position of no contracts. The large CTAs who are trading multiple systems usually trade net positions and some of them easily operate 50 or more systems at a time. 尽管理论上我们可以同时持有两个或两个以上的账户,因而能同时持有多头和空头头寸,但一般的解决方法是简简单单的持有两者相互抵消后的净头寸。两个多头头寸和一个空头头寸相互抵消后的净头寸是一个多头头寸;一个多头头寸和一个空头头寸相互抵消后的净头寸为零。许多使用多重系统的商品交易顾问(CTA)通常只建立净头寸,其中有些人能同时轻松的使用50种以上的系统。(译者的疑问:同时使用50种系统,太夸张了吧) Another possibility with the multiple position strategy is to operate with a limited exposure in terms of the maximum number of contracts traded at one time. For example, assume we wanted to trade all six of our bond systems and never have more than three contracts on at one time. For starters, the design of the bond systems makes it unlikely that we would ever have more than three positions in the same direction. But let's assume that it does happen and we are holding three long positions and a fourth system kicks in and says to go long again. We could choose to operate on a first come basis and simply ignore the fourth signal. However, as the designer of these systems I believe there might be a better solution. 当我们要限定交易暴露的风险时,也即规定同时持有的合约数目的最大量,我们会面对另一种可能出现的问题。例如,假定我们同时使用6个债券交易系统,而且我们同时持有的合约数量不得超过3个。一开始债券交易系统被设计成不会让我们在同一个方向建立3个以上的仓位,然后我们持有3个多头头寸,再然后出现第四个信号让我们再次入场做多。我们可能选择忽略第四个信号,仅按原先的入场基准坚持仓位。然而,作为这些债券系统的设计者,我相信还有更好的解决办法。 for starters 第一;首先;作为开头 I would suggest trading on the basis of giving priority to the most recent signal. If we were long three contracts and got a signal to go long again, I would switch the oldest open position and trade it as though it were the new signal. Lets say that we are long on systems A, B, and C. Then system D gives a buy signal. No new trade is entered and we operate the exits as though we are long in systems B, C and D. 我则建议根据最新的信号进行交易。如果我们已经建立了3笔多头仓位,然后又得到一个入场做多的信号,我会将之前建立的第一笔多头仓位的交易基准转换到最新信号上,这样该仓位就像是根据最新的入场信号建立起来的。比如,我们根据系统A 、 B 和 C建立起3笔多头仓位,然后系统D给出一个买入信号,虽然此时我们没有再次进行新的交易,但效果上相当于做了一次虚拟的交易,因为我们现在是根据系统B , C和D来持有多头仓位的。 The reason I prefer this method is because I know the effort that is put into designing the pre-entry setups for each system. These pre-entry setups are designed to give us an accurate reading of market conditions just as we enter each trade. These pre-entry conditions not only tell us the direction (up, down or sideways) but often tell us the present strength of the directional trend and the best time frame to be trading right now. By switching from the old position in system "A" into the new position in system "D", we will gain the benefit of using system "D's exit strategy which is most likely to be in tune with current market conditions. I like to call this process "System Updating". There is no order needed or entered with our broker to "Update" our systems. We simply stop placing exit orders for system A and commence placing exit orders for system D instead. 我之所以选择这种方法是因为每个系统的设置都是经过精心设计的。设计这些设置的目的是在我们入场交易前市场背景必须满足一定的条件。这些市场背景不仅告诉我们趋势方向(上升、下降还是横盘整理),在很多情况下还能告诉我们当前趋势的力度以及我们应该选择的交易时间框架。把原先系统“ A ”的头寸转换为系统“ D ”的头寸,我们就能使用系统D的离市策略,这会使我们受益,因为系统D有可能更适合当前的市场状况。我喜欢把这种转换过程叫做“系统更新”。在这个系统“更新”过程中,我们既不需要下订单,也不需要经纪人,需要的仅仅是取消原来系统 A设置的止损单,代之以系统D设置的止损单。 Another possibility is to limit our open positions to one long term strategy and one short term strategy so that we can monitor all six systems without having more than two positions on at one time. If we have one long term position on we will only enter a second position when it is a short term entry signal. All additional long term signals are ignored or we employ the "Updating" technique described above. [ 本帖最后由 一朵祥云 于 2009-1-31 23:08 编辑 ] |
另一种情况是我们可以将我们的交易限定在长线交易策略和短线交易策略范围内,这样即使我们同时检测6个交易系统,我们同时持有的仓位也不会超过2笔。如果我们已经建立了一个长线仓位,那么我们仅当得到短线交易信号的时候才入场建立第二笔仓位。我们要么忽略以后得到的所有长线交易信号,要么采用前面所示的“更新”技术。 As you can see, trading six systems at once does not require that we ever have six positions on at any time. In fact the specific intent designed into the multiple bond strategies is to never have more than one or two positions on at one time unless we are in a strong bull market where trading is easy and usually very low risk. In that ideal market environment we want to have as many positions on as our capital and system signals will allow. If the systems operate as designed we might have as many as four open positions under these ideal conditions. Any more than that would be very unlikely and easily handled. 如上讨论,同时使用6个交易系统并不意味着在交易过程中的某时某刻我们会同时持有6笔仓位。事实上,我们的债券市场多重交易策略的一个内含准则是:我们一般不同时持有一笔或两笔以上的仓位,除非我们正处在一个强劲的牛市,此时交易即简单而且通常风险也很低,在这种理想的市场环境中我们会在资金和系统允许的范围内持有尽可能多的头寸。按照我们设计的系统,在这种理想的条件下,我们最多同时持有4笔头寸。超过该头寸规模的可能性很小而且也很难管理。 In summary, the systems themselves should take care of most of the position sizing automatically. But in case we want to limit our exposure or use other position sizing methods there are many ways of applying logical and creative strategies that will limit our open positions to whatever number we desire. We have only illustrated a few of the many possibilities 总之,多重系统本身应该能自动照顾自己的头寸规模。但是,如果我们想限制我们的头寸暴露或者使用其他头寸调整方法,我们还能通过许多合理的有创造性的策略来限制我们的头寸规模,我们仅列举了其中部分可能的方法。 |
3、【抛砖引玉贴】如何精确控制实时交易
http://www.tradeblazer.net/forum/thread-4510-1-23.html
关于控制同方向重复发单,在第一页,已解决;
关于控制不同方向反复平仓、开仓的问题,从第二页开始,已解决;
改系统基于5min,由历史测试代码转换而来。
只是在模拟交易中,只有当日的第一根BAR有交易动作,后面其它符合开平仓条件的bar上都没有交易。
请各位帮忙看下,问题出在什么地方?
非常感谢
其中全局变量等于0表示不持仓;等于1表示持多仓;等于-1表示持空仓。
当满足条件时,平仓后立刻反手开仓。
Begin
... ...
If(BarStatus==0)
If((Time<0.145500)&&(BarStatus==2))
{