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

[amibroker] Help with stop loss condition - please !



PureBytes Links

Trading Reference Links




<FONT face="Times New Roman" 
color=#000000 size=3> <FONT 
face=Batang color=#0000ff size=2>Hi!
I am coding a stop loss that 
changes after 3 bars (when  I go short or buy a contract).
The stop loss is not executed after 3 
bars at buy price.....any idea 
why?
If also want to include sellprice in 
the code , how should i fit in?
THANKS
<FONT face=Batang color=#0000ff 
size=2> 
<FONT face="Times New Roman" 
color=#000000 size=3>Buy = Cross(EMA(C,13),EMA(C,150));Sell = 
Cross(EMA(Close,50),Close);Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short 
= Cross(EMA(C,150),EMA(C,13));Cover = 
Cross(Close,EMA(Close,50));Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);if 
(LastValue(BarIndex())<=3){ApplyStop(stopTypeTrailing,stopModePercent,4,True,False); 
//4%}else{ApplyStop(stopTypeTrailing,stopModePoint,BuyPrice,True,False);}PositionValue 
= MarginDeposit = 1;PositionSize = 1;PointValue = 
50;






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



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