在设定的时间内捕获 PA,然后将其用作分析的基线 [英] Capture PA for a set time then use this as a baseline for analysis

查看:57
本文介绍了在设定的时间内捕获 PA,然后将其用作分析的基线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午,

我不确定我脑子里的想法是否可行.

I am not sure if what I have in my head is possible.

是否可以在设定的时间内捕获价格走势,然后将其用作未来分析的基准.

Is it possible to capture Price Action over a set time to then use it as a baseline for future analysis.

例如,捕获 1200 到 1700 之间的价格走势,获取该信息的平均值,然后将其用作基线来监控 1700 之后的百分比变化.

So for example capture Price Action between 1200 to 1700, get the average of that information, then use this as a baseline to monitor the percentage change against it after 1700.

我刚刚试用了以下方法,效果不错.但是,如果没有特定时间的高点和低点的中点,我将如何平均 PA 在那段时间.

I have just trialed the below, which kinda works. But rather than have the mid point of high and low of a specific time, how would I average the PA over that time.

//@version=4
study("Baseline", overlay=false)

baselinetime = input("1500-1700", "Baseline", input.session) //set baseline range
blt = time(timeframe.period, baselinetime)


analysisrange = input("1700-2100", "Analysis Range", input.session) //set analysis range
ar = time(timeframe.period, analysisrange)

var highe_01 = 0.0
var lowe_01  = 10e10
if blt
    if not blt[1]
        highe_01 := high
        lowe_01  := low
    else
        highe_01 := max(high, highe_01)
        lowe_01  := min(low, lowe_01)

midpoint = (highe_01+lowe_01)/2
inc = (close - midpoint)//change(close, length)
p = (inc/close)*100

plot(ar ? p : na, title="Percentage Change", color=color.blue, linewidth=2, style=plot.style_linebr)

我希望这是有道理的.

##上面代码中的什么阻止了它在周末期间绘图?##更新 22/01/2021 @ 20:29将以下几行更新为以下内容以捕获周末 PA

##Also what in the code above is stopping it from plotting over the weekend period?## Update 22/01/2021 @ 20:29 Update the below lines to the below to capture weekend PA

baselinetime = input('1500-1700:1234567', title="Baseline")
analysisrange = input('1700-2100:1234567', title="analysisrange")

任何关于 1500 到 1700 平均 PA 的指导都会很棒.

Any guidance on the averaging of PA for the 1500 to 1700 would be amazing.

丹尼尔

推荐答案

如果要监听midpoint的百分比变化,那么需要改变p 到以下

If you want to monitor the percentage change from midpoint, then you need to change the calculation of p to the following

p = (inc/midpoint)*100

这篇关于在设定的时间内捕获 PA,然后将其用作分析的基线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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