보통 전략스트레이트지로 얼러트 연동하는경우 buy/sell이 분리되어 있지 않은 경우가 많습니다.

즉 하나의 얼러트로 롱/숏으로 되어있으므로 소스를 아래처럼 수정후 사용합니다.

 

트레이딩뷰 전략스트레트지 소스에서 아래와 같이 수정합니다.(빨간색)

strategy.entry("long", strategy.long, alert_message="buy")

strategy.entry("short", strategy.short, alert_message="sell")

 

트뷰 얼러트 메세지에는 아래와같이 입력합니다.

{userkey:xxxxxxxxxxxxxxxxxxx,market:bybit,symbol:btc,side:{{strategy.order.alert_message}},stoplosstype:0,qty:10p,market2:usd,msg:땡스봇}

위에 스크립트처럼 하나의 얼러트만 등록하여 사용하시면 롱/숏 메세지를 둘다 하나로 받을수 있습니다.

+ Recent posts