Announcement

Collapse
No announcement yet.

Erroneous Order Sent to IB test account.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi Glen,

    I did not run this or look at the code in detail, but based on your descriptions to date, and my cursory review of the efs you posted, I believe it is highly likely that that it has to do with the 'true global variables' that are used in this application. I can go into the reasons for this, but it is described here http://kb.esignalcentral.com/article...ticle=1112&p=4 and here http://kb.esignalcentral.com/article...ticle=1077&p=4.

    The efs uses setGlobalValue(...) and getGlobalValue(...) commands to trade positions. These global values are shared across charts but are differentiated between charts by the function 'getInvokerID()' which is unique to the window. This will ensure that the global values are unique to the chart that is open. Even when you close the efs, these 'true global variables' continue to exist until you specifically delete them.

    I believe what is happening is that you are grabbing pre-existing globalValues. As I said before, they will remain in existance until you specifically delete them (or close eSignal)

    My recommendation is that you check this. Use debugPrintln or any other tool to determine the status of these variables before you set them or press a button.

    If you find this to be the case, there are viable solutions.

    Comment


    • #17
      Originally posted by stevehare2003
      Hi Glen,

      I did not run this or look at the code in detail, but based on your descriptions to date, and my cursory review of the efs you posted, I believe it is highly likely that that it has to do with the 'true global variables' that are used in this application. I can go into the reasons for this, but it is described here http://kb.esignalcentral.com/article...ticle=1112&p=4 and here http://kb.esignalcentral.com/article...ticle=1077&p=4.

      The efs uses setGlobalValue(...) and getGlobalValue(...) commands to trade positions. These global values are shared across charts but are differentiated between charts by the function 'getInvokerID()' which is unique to the window. This will ensure that the global values are unique to the chart that is open. Even when you close the efs, these 'true global variables' continue to exist until you specifically delete them.

      I believe what is happening is that you are grabbing pre-existing globalValues. As I said before, they will remain in existance until you specifically delete them (or close eSignal)

      My recommendation is that you check this. Use debugPrintln or any other tool to determine the status of these variables before you set them or press a button.

      If you find this to be the case, there are viable solutions.

      Steve,

      Thanks very much for taking the time to look into this issue, I appreciate it. When I reran the efs after removing the Global variables the problem still occurs. In addition the original efs strategy that I first discovered the issue with also did not use any global variables.

      I'm familiar with true global variables and thier behavior and getInvokerId(). They are being used in this program simply to enable or disable the buttons, beyond that they are unrelated but do appreciate the heads up on their use. As I said a single line efs of closePosition() will produce the error.


      The problem is actually much simplier than that. Any invocation of the closePosition() and closeAllPositions() EFS generic broker functions when executed in this account sends out an erroneous sell order for $850,000 GBP A0-FX.

      This is not an arbitrary amount but is the cumulative value of my year to date GBP positions and is erroneously being picked up within the closePositions() and closeAllPostions() efs functions as a current long position, and an order which should never get sent out is being sent out.

      It's easily reproduced and most likely will eventually occur in some else actual trading account. I've done everything I can possibly do to document fully, offer my account, and essentially prove the bug exists.

      If that happens to be my account after documenting and making everyone aware of the software defect, then someone's paying the bill for the damage and it won't be me....



      Appreciate the help Steve, take care.


      glen
      Last edited by demarcog; 03-07-2007, 08:53 PM.
      Glen Demarco
      [email protected]

      Comment


      • #18
        Hi Glen,

        If you uncheck "Include FX positions in portfolio", will your efs still send orders to close the 85000 GBP position when calling closeAllPositions()?

        - Clearpicks

        Comment


        • #19
          Originally posted by clearpicks
          Hi Glen,

          If you uncheck "Include FX positions in portfolio", will your efs still send orders to close the 85000 GBP position when calling closeAllPositions()?

          - Clearpicks
          Hey Mike,

          Yeah, clicked or unclicked the order still goes out, for closePosition() and closeAllPositions(), scarey!

          Thanks,

          Glen
          Glen Demarco
          [email protected]

          Comment

          Working...
          X