ACE X CA X Lead Capital 量化課程
· 4 min read
Details
此頁的QR連結
Details
課綱
Crypto-Arsenal
- 註冊連結 (可以 Google 註冊)
- 如何用 CA 串接和自動化任何
TradingView
策略: 到 Strategy >New Strategy
>TradingView
(詳細教學) - 如何用 CA 回測和實單策略: 到 Strategy >
New Strategy
>Technical Indicator
>EMA
TradingView
7/26 簡易EMA
策略 + 簡易 Filter (濾網) i.e RSI
& Momentum
//@version=5
strategy(title="CA_test", shorttitle="EMA", overlay=true, default_qty_value = 80)
ema10 = ta.ema(close,10)
ema20 = ta.ema(close,20)
//filter
rsi = ta.rsi(close,20)
mom = math.abs( ta.mom(close,49) )
//condition
long = ta.crossover(ema10,ema20)
short = ta.crossunder(ema10,ema20)
//position
if(long and mom >= 10 and rsi < 50)
if(strategy.position_size != 0)
strategy.close_all()
strategy.entry("long",strategy.long)
if(short and mom >= 10 and rsi > 50)
if(strategy.position_size != 0)
strategy.close_all()
strategy.entry("short",strategy.short)
if( rsi > 80 or rsi < 20 )
strategy.close_all()
plot(rsi , color = color.blue)
plot(ema10, color=#f37f20)
plot(ema20 , color = color.red)
7/19 簡易EMA
策略
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Crypto-Arsenal
//@version=5
strategy("我的策略", overlay=true, margin_long=100, margin_short=100)
//@version=5
//indicator(title="Moving Average Exponential", shorttitle="EMA", overlay=true, timeframe="", timeframe_gaps=true)
ema10 = ta.ema(close,10)
ema20 = ta.ema(close,20)
plot(ema10, title="Smoothing Line", color=#f37f20)
plot(ema20, title="Smoothing Line", color=#4320f3)
longCondition = ta.crossover(ema10,ema20)
if (longCondition)
strategy.close_all()
strategy.entry("My Long Entry Id", strategy.long)
shortCondition = ta.crossunder(ema10,ema20)
if (shortCondition)
strategy.close_all()
strategy.entry("My Short Entry Id", strategy.short)