Announcement

Collapse
No announcement yet.

Paper Trade with EFS

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

  • Paper Trade with EFS

    Hi there!

    After some diffcult implementations of my own strategies, I'm now ready to test this witch the PaperTrade functionality of eSignal.
    Could anyone help me, how to use the different functions.
    I don't no whixg function I have to use in the differetn cases.
    The basic help isn't really helpfull.

    what should I implement the following snippets:

    /* ther ist the buy/sell trigger */
    if(buy){
    trade.buyMarket("symbol",1);
    }else if(sell){
    trade.sellMarket(("symbol",1);
    }

    /* close trade when short or long */
    if(isLong && stopTrigger){
    trade.sellMarket(("symbol",1)
    }else if(isShort && stopTrigger){
    trade.sellShortMarket("symbol",1);
    }

    Is the code above correct?
    Could I find any sample code in the forum?

    Many thanks for yout answer!!!

    Greetings
    Markus

  • #2
    there are a couple of things..

    you should consider as you impliment this code..

    first, to BUY, you should pass a POSITIVE number of shares/contracts

    second, to SELL (or close out a buy), you should pass a NEGATIVE number of contracts.

    third, this method does not include commissions and slippage, so I suggest reducing the daily total by about 15% to make it realistic.

    Here is a more realistic method of firing your trades.. If you need more help, let me know.

    PHP Code:
    /* there is a buy/sell trigger */
    if(buy){
      
    trade.Buy(getSymbol(),100,PaperTradeBroker.MARKET);
    }else if(
    sell){
      
    trade.Sell(getSymbol(),-100,PaperTradeBroker.MARKET);
    }

    /* close trade when short or long */
    if(isLong && stopTrigger){
      
    trade.Sell(getSymbol(),-100,PaperTradeBroker.MARKET);
    }else if(
    isShort && stopTrigger){
      
    trade.Buy(getSymbol(),100,PaperTradeBroker.MARKET);

    Brad Matheny
    eSignal Solution Provider since 2000

    Comment

    Working...
    X