Files

63 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2023-01-11 17:10:25 +08:00
2023-07-14 18:39:48 +08:00
> Name
2023-01-11 17:10:25 +08:00
2023-04-18 23:12:35 +08:00
Gann-High-Low
2023-01-11 17:10:25 +08:00
2023-07-14 18:39:48 +08:00
> Author
2023-01-11 17:10:25 +08:00
Zer3192
2023-07-14 18:39:48 +08:00
> Strategy Arguments
2023-01-11 17:10:25 +08:00
2023-07-14 18:39:48 +08:00
|Argument|Default|Description|
2023-01-11 17:10:25 +08:00
|----|----|----|
|v_input_1|13|HIGH Period|
|v_input_2|21|LOW Period|
2023-07-14 18:39:48 +08:00
> Source (PineScript)
2023-01-11 17:10:25 +08:00
2024-03-03 22:27:55 +08:00
``` pinescript
2023-01-11 17:10:25 +08:00
/*backtest
start: 2021-05-08 00:00:00
end: 2022-05-07 23:59:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
indicator('Gann High Low', overlay=true)
HPeriod = input(13, 'HIGH Period')
LPeriod = input(21, 'LOW Period')
iff_1 = close < nz(ta.sma(low, LPeriod))[1] ? -1 : 0
HLd = close > nz(ta.sma(high, HPeriod))[1] ? 1 : iff_1
HLv = ta.valuewhen(HLd != 0, HLd, 0)
sma_1 = ta.sma(high, HPeriod)
sma_2 = ta.sma(low, LPeriod)
HiLo = HLv == -1 ? sma_1 : sma_2
HLcolor = HLv == -1 ? color.maroon : color.blue
plot(HiLo, linewidth=2, color=HLcolor)
alertcondition(ta.cross(close, HiLo), title='Price Cross Alert', message='Price - HiLo Crossing!')
alertcondition(ta.crossover(close, HiLo), title='PRICE CrossOver Alarm', message='LAST PRICE is ABOVE HiLo')
alertcondition(ta.crossunder(close, HiLo), title='PRICE CrossUnder Alarm', message='LAST PRICE is BELOW HiLo!')
buySignal=ta.crossover(close, HiLo)
sellSignal=ta.crossunder(close, HiLo)
if buySignal
strategy.entry("buy", strategy.long)
else if sellSignal
strategy.entry("sell", strategy.short)
```
2023-07-14 18:39:48 +08:00
> Detail
2023-01-11 17:10:25 +08:00
https://www.fmz.com/strategy/370655
2023-07-14 18:39:48 +08:00
> Last Modified
2023-01-11 17:10:25 +08:00
2022-06-25 10:00:25