need help auto trading

Discussion in 'Interactive Brokers' started by SalehTrade, Apr 11, 2023.

  1. I want to auto trade through Interactive Brokers, but there is a problem that I can't find a solution for. I don't want to set take profit and stop loss. Instead, I want take profit and stop loss based on unrealized P&L, for example, I buy aapl, I need when aapl unrealized P&L reaches $10 i sell that position , when unrealized P&L down $10 i stop loss that position .
     
  2. Overnight

    Overnight

    You are in a world of hurt. This is based on the fact that you need to ask that question, and then answer your own question in the same post.
     
  3. Sekiyo

    Sekiyo

    If you can’t set TP and SL in dollars or percents then you need to do the math by yourself …

    I know TradingView allows to set targets based on $Change or %Change, PnL wise.

    You can log into IB through TradingView
     
  4. Businessman

    Businessman

    Why do we need to spell it for you:

    If you buy 10 shares of apple at 100. Then set you profit at 101 and stop loss at 99.

    If you buy 5 shares of apple at 200. Then set your profit at 202 and stop loss at 198.

    It is basic maths, just use a spread sheet or because you are coding an auto trading algo you need to put the maths inside it.
     

  5. thanks
     

  6. I know that but Trading View can charge a fee for trading ?
     


  7. I do this but I expected if I did it by p&l it would be accurate
     
  8. Sekiyo

    Sekiyo

    Depends they offer different packages.
    There’s a free level. You can try it.
    No fees for execution.
     

  9. thanks a lot
     
  10. I assume that you are not a developer, otherwise you would have gone already to take a look at the API website.

    https://interactivebrokers.github.io/tws-api/introduction.html

    If you want to automate your trading strategy without writing any code, look for "no-code" solutions. There are many available. You will be presented a graphical UI with some sort of boxes and arrows where you can set your workflows and triggers based on dynamic values.
     
    #10     Apr 12, 2023
    Sekiyo likes this.