Announcement

Collapse
No announcement yet.

Setting stops and targetted exits in backtests

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

  • Setting stops and targetted exits in backtests

    Hi,

    I'm new to E-signal and I hope someone can help.

    I would like to be able to add stops and targeted exits to some of the backtests I now have.

    Any idea of how to do this. Obviously I don't want to be setting a price, but rather a difference between the open price and the stop and target.

    For example, if the Strategy is Long, I want to, get the open price and set a sell stop at say 1 point below the buy price and a sell limit order at say 2 points above. I want to do this on a bracket order basis where the limit exit is cancelled out by the stop and the stop by the limit order...

    (vice versa for shorts)

    This one has me beat.



    Helllllllllllllllllp!!!!!!!!!!!!!!!!


    Many thanks
    Natalie

  • #2
    Re: Reply to post 'Setting stops and targetted exits in backtests'

    without seeing your code it is hard to describe exactly what to do but...

    When you get filled long, store the fill price in a variable, then set your
    sellstops at fill+2 or fill-1.

    ----- Original Message -----
    From: <[email protected]>
    To: <[email protected]>
    Sent: Sunday, December 29, 2002 5:29 PM
    Subject: Reply to post 'Setting stops and targetted exits in backtests'


    > Hello dloomis,
    >
    > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    >

    Comment


    • #3
      Re: Re: Reply to post 'Setting stops and targetted exits in backtests'

      Thanks for the reply. That's effectively what I intended to do, and set a new variable for the fill price, but how do I get the fill price. Is there a specific line to use like

      GetFillPrice or something like that?

      It's a straightforward MA crossover limited to execute within 0930 - 2100 (not dissimilar to the example they give in the backtest section) but uses 2 MA's instead of one.

      Thanks again

      Natalie

      Comment


      • #4
        Re: Reply to post 'Setting stops and targetted exits in backtests'

        http://www.esignalcentral.com/traini...ackTesting.asp

        says ... (among other things)

        Strategy.doLong("Go Long", Strategy.CLOSE, Strategy.THISBAR);
        Go long 100 shares at the closing value of the current bar.

        So this is how you find the 'fill' price - check the close of the last bar.


        ----- Original Message -----
        From: <[email protected]>
        To: <[email protected]>
        Sent: Sunday, December 29, 2002 5:46 PM
        Subject: Reply to post 'Setting stops and targetted exits in backtests'


        > Hello dloomis,
        >
        > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        >

        Comment


        • #5
          Re: Re: Reply to post 'Setting stops and targetted exits in backtests'

          Thank you for the help. Much appreciated.

          Natalie

          Comment


          • #6
            What if we want to enter on a stop?

            On a similar note to Natalie's question...

            I've been struggling with this one most of the day:

            What if we don't want to get in on the close of this bar, but rather with a stop order on the next bar. If we use a statement like:

            Strategy.doLong("GettinLong", Strategy.STOP, Strategy.NEXTBAR);

            Do we have to preceed that with a separate statement like:
            Strategy.setStop = the_stop_entry_price ;

            Does it take a "()" in there?

            Many thanks for your assistance!

            Christy

            Comment


            • #7
              Found some answers

              After more digging through the tangled web of online documentation, finally found enough answers to get me on my way:

              http://share.esignal.com/download.js...testingref.doc

              shows how to enter with stops/limits on the next bar.

              Cheers!
              C

              Comment

              Working...
              X