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


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

   

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


  共有3574人关注过本帖树形打印复制链接

主题:[原创]currentbar

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


加好友 发短信
等级:新手上路 帖子:19 积分:0 威望:0 精华:0 注册:2014/9/10 13:03:41
[原创]currentbar  发帖心情 Post By:2014/9/10 13:15:29    Post IP:218.80.192.232[只看该作者]

请问Easylanguage里的 CurrentBar 保留变量 在金字塔里对应的是什么函数或用法?

 回到顶部
美女呀,离线,留言给我吧!
pyd
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/9/10 13:20:03    Post IP:58.246.57.26[只看该作者]

CurrentBar 请解释下

 回到顶部
帅哥哟,离线,有人找我吗?
王锋
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:11808 积分:20695 威望:0 精华:10 注册:2009/8/18 8:15:13
  发帖心情 Post By:2014/9/10 13:24:57    Post IP:36.250.232.72[只看该作者]

看看是不是BARPOS


金字塔—专业程序化软件提供商

金字塔-技术部

-----------------------------------------------------------------------------------------------------

工作时间:周一至周五 08:30 - 17:30   周末及法定节假日休息

Email:service@weistock.com
 回到顶部
帅哥哟,离线,有人找我吗?
optimus
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | 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.


 回到顶部
美女呀,离线,留言给我吧!
pyd
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/9/10 13:26:54    Post IP:58.246.57.26[只看该作者]

看3楼的回复,你试试函数barpos效果


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


加好友 发短信
等级:新手上路 帖子:19 积分:0 威望:0 精华:0 注册:2014/9/10 13:03:41
回复:(pyd)看3楼的回复,你试试函数barpos效果  发帖心情 Post By:2014/9/10 13:28:45    Post IP:218.80.192.232[只看该作者]

好的,我试试

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


加好友 发短信
等级:新手上路 帖子:19 积分:0 威望:0 精华:0 注册:2014/9/10 13:03:41
回复:(王锋)看看是不是BARPOS  发帖心情 Post By:2014/9/10 13:29:05    Post IP:218.80.192.232[只看该作者]

好的,我试试

 回到顶部