[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] How to code different StopLosses for Long/Short?



PureBytes Links

Trading Reference Links

Posted this under the wrong topic :-(

something along this line?

LPos = Flip(Buy,Ref(Sell,-1));
SPos = Flip(Short,Ref(Cover,-1));
LPT = 3;//Optimize("LProfitTarget",6.5,0,10,0.2);
SPT= 5;//Optimize("SProfitTarget",7.5,5,15,0.2);
PT =IIf(LPos,LPT*ATR(3),IIf(SPos,SPT*ATR(3),0));
ExitAtStopLevel = True; ExitAtNextExitPrice = False;
ApplyStop(1,1,PT,ExitAtStopLevel);

herman
  -----Original Message-----
  From: quexos0 [mailto:quexos0@xxxxxxxxxxxx]
  Sent: Thursday, October 07, 2004 8:55 AM
  To: amibroker@xxxxxxxxxxxxxxx
  Subject: [amibroker] How to code different StopLosses for Long/Short?



  Is there a way to tell Amibroker automatic analysis to use a
  different stoploss value for Longs and Shorts?

  Say 5pt stoplosses for Longs and 4pt stoplosses for Shorts.

  Thanks in advance!





  Check AmiBroker web page at:
  http://www.amibroker.com/

  Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html


        Yahoo! Groups Sponsor
              ADVERTISEMENT





----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

    b.. To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/