欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [原创]currentbar

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有3569人关注过本帖平板打印复制链接

主题:[原创]currentbar

帅哥哟,离线,有人找我吗?
optimus
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:19 积分:0 威望:0 精华:0 注册:2014/9/10 13:03:41
回复:(pyd)CurrentBar 请解释下  发帖心情 Post By:2014/9/10 13:25:15    Post IP:218.80.192.232[只看该作者]

就是easylanguage写的代码,想转成金字塔。CurrentBar的easylanguage解释是:

Returns the number of the bar currently being evaluated.

Each bar on a chart (after the number of bars specified by the Maximum number of bars referenced by a study, known as MaxBarsBack) is assigned a number, which is incremented by 1 with each successive bar. For example, if your MaxBarsBack is set to 10, the 11th bar is CurrentBar number 1, the 12th bar is CurrentBar number 2, and so on.

Remarks

CurrentBar can only be used to return the number of the current bar, for example, you cannot use:

CurrentBar[n]

... to obtain the bar number of the bar n bars ago. However, you can obtain the number of the bar n bars ago (for example, 5) by using:

CurrentBar - 5

Also, the CurrentBar reserved word is the same as the user function BarNumber. The only difference is that you can use the BarNumber function to reference past bars:

BarNumber[5]

Examples

You can use CurrentBar to determine how long ago a particular condition occurred:

If Condition1 then
 
Value1 = CurrentBar; 
If
 CurrentBar > Value1 then
 
Value2 = CurrentBar - Value1;

Value2 would hold the number of bars ago Condition1 occurred.


 回到顶部