当价格触及该线时,我该如何开仓?
How can I open a trade when the price touches the line?
我正在尝试在背景为绿色 (TrendDirection == 1) 且价格触及紫色线 (pacU) 时输入。
Sample Long Position
我已经尝试过在蜡烛的最低水平低于该线时给我一个信号,但它没有给我任何信号。
haLow = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, low)
pacU = ta.ema(haHigh, HiLoLen)
longCondition = false
if(TrendDirection == 1 and ta.crossunder(haLow, pacU))
longCondition = true
if (longCondition)
strategy.entry("long", strategy.long, 100)
给变量赋新值时需要使用:=
运算符。
所以,应该是longCondition := true
可莱凝胶素。
我正在尝试在背景为绿色 (TrendDirection == 1) 且价格触及紫色线 (pacU) 时输入。
Sample Long Position
我已经尝试过在蜡烛的最低水平低于该线时给我一个信号,但它没有给我任何信号。
haLow = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, low)
pacU = ta.ema(haHigh, HiLoLen)
longCondition = false
if(TrendDirection == 1 and ta.crossunder(haLow, pacU))
longCondition = true
if (longCondition)
strategy.entry("long", strategy.long, 100)
给变量赋新值时需要使用:=
运算符。
所以,应该是longCondition := true
可莱凝胶素。