Username: Password:

Author Topic: Tradingview script  (Read 3074 times)

Offline Kaaskop

  • Trust: (0)
  • Rookie
  • *
  • Posts: 1
    • View Profile
Tradingview script
« on: January 15, 2019, 12:43:10 PM »
Hi Guys,

I am about to purchase gunbot + tradingview addon.

I have a question since my pine script on tradingview works with "long" and "short" and it actually always swap between those 2 (im only not holding positions with stops get it)

What will happen if i use gunbot with the long and short alerts via email, will it first close my open position before taking a new one?
When i backtest on tradingview it does close the position before opening a new short/long.

Thanks in advance.

Offline Aitor

  • Global Moderator
  • Trust: (+2)
  • Contributor
  • *****
  • Posts: 244
    • View Profile
  • Telegram: @AitorRuiz
Re: Tradingview script
« Reply #1 on: January 16, 2019, 04:49:36 AM »
Hi Kaaskop, usually the exchanges don't allow to keep a long position and a short position opened at the same time. So, if you already have a short position opened (for example, 1000$), if you open directly a long position with 2000$, it would automatically close your short and open a 1000$ long. If you want to open both longs and shorts at the same time, you would need 2 accounts. In the case you have 1 account, the way to go is to close the previous one before opening other position. For example, you open a short, then close that short, now open a long.