Pine-Script + 优化时间较短,回测 [英] Pine-Script + Optimize with lower timeframe, backtest

查看:142
本文介绍了Pine-Script + 优化时间较短,回测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以通过应用较短的时间范围来退出订单来进行更精确的回测.

I would to know if it is possible to make a more precise backtest by applying a lower timeframe to exit the order.

例如,我有一个每日时间框架策略,但在柱线关闭时完成退出交易,有时在达到第一个止盈或止损时会令人困惑.

For example, I have a DAILY timeframe strategy, but exit transactions are done when the bar is closed and sometimes it is confusing when what the first Take-Profit or Stop-Loss is reached.

我尝试应用一分钟的时间范围来关联止损和止盈触发器,但它似乎没有在回测开始的同一时间开始.我已经绘制了一分钟"时间范围,并且正在编程以从当前时间开始.

I tried to applicate a timeframe of one minute to affinate the Stop and Take-Profit trigger but it seems not to start in the same time of the begining of the backtest. I have plot One Minute time frame and it is programming to begin from the current time.

有没有在回测开始日期设置 1 分钟时间范围开始的解决方案?也许通过升级帐户?赞成 prenium 吗?

There is a solution to set the begining of 1 minute timeframe at the start date of the backtest ? Maybe through an upgrade of the account ? Pro toward prenium ?

推荐答案

您的策略在图表的时间范围内运行,该解决方案决定了您的策略可用于生成和处理历史柱形订单的最精细细节.您可以使用 security() 访问更高的时间范围信息并将其用于计算.

Your strategy runs on the chart's timeframe, and that resolution dictates the finest amount of detail your strategy can use to generate and process orders on historical bars. You can use security() to access higher timeframe information and use that in your calculations.

当您的策略在实时栏中运行时,您可以选择以比图表分辨率更精细的分辨率启用订单处理,使用 strategy()calc_on_every_tick= 参数,但请记住,虽然这会起作用对于正向测试,您的回溯测试不会反映该行为,因为电视上的历史条形图只有 OHLC 信息.

When your strategy runs in the realtime bar, then you have the option of enabling order processing at a finer resolution than the chart's resolution, using strategy()'s calc_on_every_tick= parameter, but keep in mind that while that will work for forward testing, your backtesting will not reflect that behavior, as historical bars on TV have only OHLC information.

这篇关于Pine-Script + 优化时间较短,回测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆