Announcement

Collapse
No announcement yet.

Closing a PaperTrade via EFS

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

  • Closing a PaperTrade via EFS

    If this has already been addressed in the forum, I can't find it. Please point me in the right direction.

    I am able to open an eSignal PaperTrade via EFS code, but am unable to close it (the trade).

    Example:
    I place a Sell to open a short position,
    later a Buy to cover (close the short),
    then a Buy to open a long position.
    What I get is three open orders... ?
    I would expect the first Buy to close out the Sell, but it doesn't.

    Maybe I don't understand how this functions. I would expect to see OPEN trades in Executions tab and CLOSED trades in Trade History tab.

    Traded symbol is EUR A0-FX, if that matters.

    Snippets of PaperTrade code used:
    // Script Global Variable Declarations
    var vPTrade = null;
    // executed in Main()
    if ( (vPaperTrade == "true") && (vPTrade == null) ) {vPTrade = new PaperTradeBroker};
    // if (vPaperTrade == "true")~
    vPTrade.Sell(getSymbol(),100,PaperTradeBroker.MARK ET,close()
    // if (vPaperTrade == "true")~
    vPTrade.Buy(getSymbol(),100,PaperTradeBroker.MARKE T,close()

    Thanks,
    Ted.

    -function THEO( ComparingESignalExecutedPricesToDynaOrderExecutedP rices)
    Attached Files
    Last edited by tedsmith; 04-30-2004, 12:35 PM.

  • #2
    Portfolio window...

    Notice quantity = 300

    -Ted.
    Attached Files

    Comment


    • #3
      some help...

      Ted,

      You have to BUY a positive number ( like 100 or 300)...

      and SELL a NEGATIVE number (like -100 or -300).

      that is the trick.

      B
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment

      Working...
      X