in Search

get stoped out by trailing stop before initial fix stop

Last post 03-29-2008, 20:25 by asx trader. 7 replies.
Sort Posts: Previous Next
  •  03-28-2008, 6:18 26767

    get stoped out by trailing stop before initial fix stop

    Hi All,

     

     

    I got a problem in defining exit strategy. The major problem is the trailing stop argument which was kickin in before the initial stop. So I always get stop out even before the initial stop.Can someone in this forum assist me with

     

    IF function ???

     

     

    this is a sample logic tradesim

     

      

    LongEntryTrigger := a;

     

     

     LongEntryPrice := OPEN;

     

    LongInitialStop := If(Ref(C,-1)> 0.91*LongEntryPrice,0.91*LongEntryPrice,Ref(C,-1));

     

    LongExitTrigger := ExtFml( "TradeSim.TrailingStop",TRIGGER,LONG,3*ATR(10),High,Low);

     

     LongExitPrice := O;(I think it is here the major problem)

     

     

     

    thank you for your assistant

     

     

    regards

     

    asx trader

     

     

     

  •  03-28-2008, 10:09 26773 in reply to 26767

    Re: get stoped out by trailing stop before initial fix stop

    asx trader,

    Difficult to tell if  "O" is alpha or numeric.

    If alpha it would stand for open and means that your entry and exit are the same. If its zero then you have waited too late.

    I would think that your exit price if long would be the open but only if you are lower than the LongExitTrigger low.

    Evaluating a snippet of code is nearly impossible. It helps to see the complete code when asked to consider system logic.

     

    Preston



    equismetastock@yahoogroups.com
  •  03-28-2008, 16:52 26780 in reply to 26773

    Re: get stoped out by trailing stop before initial fix stop

    O is OPEN

    The entry arguments is fine but when it come to initial stop and trail stop it turns out to be daisy.

    lets assume the long exit trigger is close and the openign trade is open. I believe the logic sequence is clear.

    Appreciate if any one who have any ideas with if fucntion or any additional function

     

     

     

  •  03-28-2008, 20:17 26781 in reply to 26780

    Re: get stoped out by trailing stop before initial fix stop

    Hi ASX Trader,

    I take it from the code that this is a Long System?

    For the InitialStop try something along these lines:- 

    LongInitialStop :=0.91*LongEntryPrice;

    It might pay to check the ExitPrice code with the Tradesim Manual but it will probably look similar to this:-

    LongExitPrice:=If(O<Ref(LongExitTrigger,-1),O,Ref(LongExitTrigger,-1);

    or perhaps:-

    LongExitPrice:=If(O<LongExitTrigger,O,LongExitTrigger);

    Your ExitTrigger refers to HIGH & LOW which I believe is more often used for an intraday exit whereas HIGH & CLOSE are used for next day exit.

    Cheers,

    ozt

  •  03-28-2008, 21:07 26782 in reply to 26780

    Re: get stoped out by trailing stop before initial fix stop

    asx trader,

    With an EOD system you would need to reference yesterday's exit trigger. An if statement is difficult to use because you would not be able to satisfy both the else and then equations necessary. ValueWhen should do the trick. Like this:

     LongExitPrice :=ValueWhen(1,Ref(LongExitTrigger,-1),Open) ;

     

    I don't believe that you will need a value argument for LongExitTrigger since you simply need the condition to be true. If the output of the LongExitTrigger is a continuous value then something like

     

     LongExitPrice :=ValueWhen(1,ref(close,-1) < Ref(LongExitTrigger,-1),Open) ;

     

    should do the trick.

      

     

    Hope this helps,

     

    Preston



    equismetastock@yahoogroups.com
  •  03-29-2008, 1:53 26783 in reply to 26782

    Re: get stoped out by trailing stop before initial fix stop

    To Oz trader and Preston

    Thanks for the response , but I think It will be clear when I give more explanation.  For example let's pull out SMM(Summit Resources) the trading signal  was on 29/12/06 and the next following morning I enter the trade at predefined limit price. Now, here comes the major issues i.e. at 11/1/2007 I got stoped out by trailling stp. It should have wait the initial stop before it did its duties

    can value when fuction or alert and if fuction prevent this early trailing stop ? if it can how?

     

     

     

  •  03-29-2008, 4:18 26785 in reply to 26783

    Re: get stoped out by trailing stop before initial fix stop

    Hi asx trader,

    Unfortunately you are making it a bit awkward to comment in that you haven't posted your TradeSim instruction code for the system.

    Now at least we can relate your sytem code to SMM which should make things easier!

    Given that SMM triggered on 29/12/06 and you entered at OPEN on the next bar ($3.12) then the system stop loss is "0.91*LongEntryPrice" which would equal $2.8392 on the data I use.

    Your code (If(Ref(C,-1)> 0.91*LongEntryPrice) seems somewhat unusual for an InitialStop as in IMO you need to give the Long trade a chance to develop and would thus use Ref(CLOSE,-1) < 0.91*LongEntryPrice. However, as stimulated, that is just my opinion.

    The "reason" for the ExitTrigger trailing stop, as I understand it, is to hopefully protect profits and thus activate an EXIT which is above our InitialStop.

    So lets calculate the ExitTrigger value given on 10/1/2007 based on the code posted:-

    (ExtFml( "TradeSim.TrailingStop",TRIGGER,LONG,3*ATR(10),High,Low));

    which is approxiamately $3.0326 (i.e. higher than the InitialStop of  $2.8392) and therefore a valid ExitTrigger!

    Whilst the ExitPrice depends on the TradeSim code used in the system I would suggest it is probably at $3.02 which is the value of the OPEN on 11/1/2007.

    Hope this all makes sense and I haven't missed any issues.

    All the best asx trader,

    ozt

     

  •  03-29-2008, 20:25 26792 in reply to 26785

    Re: get stoped out by trailing stop before initial fix stop

    thanks for your response. by changing > to < symbol it even change the equity curve worst.

    it should have a solution to this function.

    I just try to simulate a trading performance close to reality, I dont think any one will exit the trade by his/ her trail stop before the initial stop get triggerred.

    I think I might ask David Sambrosky about this issues.

     

View as RSS news feed in XML