Error IB API

Discussion in 'Automated Trading' started by Leopard9, Sep 25, 2024.

  1. spy

    spy

    The distinction being that the moderators can't moderate something they don't understand. So, if in their ignorance, they find a joke too offensive and censor it, they will end up degrading the conversation.

    And, maybe if you look closely at the differences between the code I posted and what you posted... you'll learn something about how to format your question appropriately. You have to be able to walk before you can run.

    Sometimes you fall, and you need to get up on your own or you'll never learn anything.

    "Many computer scientists have fallen into the trap of trying to define languages like George Orwell's Newspeak, in which it is impossible to think bad thoughts. What they end up doing is killing the creativity of programming."
    --- Larry Wall​
     
    Last edited: Sep 30, 2024
    #71     Sep 30, 2024
  2. Leopard9

    Leopard9


    You took more time editing your own crappy reply than helping out. The moderators may not clean this up but I certainly will. You´re Joining your friend on the ignore list. Ta-da.
     
    #72     Sep 30, 2024
  3. spy

    spy

    And this is meant to hurt me?!?!? Ok.

    Read the edited reply again and, instead of just expecting the answer to be served up on a silver platter, give it a more thoughtful effort.
     
    Last edited: Sep 30, 2024
    #73     Sep 30, 2024
  4. Oh no!

    Since Mr Parasite didn't manage to fix it, now he has to paste the whole code!

    He must be desperate if that whole piece of crap was published out there in the open. People can get rich with it now. No more jokes fellows, this is the moment you've been waiting for. The whole code is yours.

    And do not contradict him because if you do you will go to his vip ignore-list! He is doing the admins' job, don't forget that.

    This is turning to be comedy gold.
     
    #74     Sep 30, 2024
    spy likes this.
  5. ph1l

    ph1l

    Bear in mind, I know neither python nor the Interactive Brokers API, but ...

    entry_order_ref appears to be a string with value "20240930120328_ENTRY" which looks like a timestamp followed by "_ENTRY"

    The code you posted
    Code:
    contract = order_details[1]
    trade_id = int(entry_order_ref.split('_')[0])
    original_order_id = int(entry_order_ref.split('_')[1])
    cancel_price = float(entry_order_ref.split('_')[4])
    ...
    t.datetime_stamp = entry_order_ref.split('_')[2]
    
    appears to expect entry_order_ref to have at least 5 fields separated by "_"

    So, perhaps the data changed, so the fields the code thinks are in entry_order_ref are someplace else such as in order_details.

    Since python depends on indentation, it would be helpful to surround posted code with CODE tags.
    https://www.elitetrader.com/et/help/
    upload_2024-9-30_23-9-30.png
    That would make it easier for someone like @d08 who knows python and the Interactive Brokers API to help more.
     
    #75     Oct 1, 2024
    Leopard9 likes this.
  6. Leopard9

    Leopard9

    This works in the morning (In europe) but not in the afternoon. I don´t get it. Must be time related.
     
    #76     Oct 1, 2024
  7. Afternoon is siesta time, he should know that.
     
    #77     Oct 1, 2024
  8. Leopard9

    Leopard9

    It has been fixed. Thank you to those who helped!
     
    #78     Oct 2, 2024
  9. You are welcome.
     
    #79     Oct 2, 2024