简体   繁体   English

Pine-Script + Optimize 以更短的时间框架,回测

[英]Pine-Script + Optimize with lower timeframe, backtest

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.我有 plot 一分钟时间范围,它正在编程从当前时间开始。

There is a solution to set the begining of 1 minute timeframe at the start date of the backtest?有一种解决方案可以在回测的开始日期设置 1 分钟时间范围的开始吗? Maybe through an upgrade of the account?也许通过升级帐户? Pro toward prenium?临走向高级?

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.您可以使用security()访问更高的时间范围信息并在计算中使用它。

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.当您的策略在实时柱中运行时,您可以选择使用strategy()calc_on_every_tick=参数以比图表分辨率更精细的分辨率启用订单处理,但请记住,虽然这适用于前向测试,您的回测不会反映这种行为,因为电视上的历史酒吧只有 OHLC 信息。

As of May 30, 2022;截至 2022 年 5 月 30 日; if you have a Premium TradingView account (the highest level) then you can make use of the new 'Bar Magnifier' feature ( ref ), which seems to allow for this finer grain accuracy:如果您有 Premium TradingView 帐户(最高级别),那么您可以使用新的“条形放大镜”功能 ( ref ),这似乎可以实现更精细的粒度精度:

Premium account holders can now obtain more realistic order fills in their strategy backtests by using The Bar Magnifier option.高级账户持有人现在可以通过使用条形放大镜选项在他们的策略回测中获得更真实的订单填充。 This tool uses intrabar inspection to obtain deeper granularity on price movement within a bar, allowing for more precise order fills.该工具使用柱内检查来更深入地了解柱内的价格变动,从而实现更精确的订单成交。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM