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

[amibroker] only one trade a day, and transform the stop in trailing stop



PureBytes Links

Trading Reference Links

hi, i'm doing a very easy concept formula but finding many problems. 
the purpose is enter long or short only when are broken high or low 
of the 12 candles before. 
when trade start, i want to put a stop loss of 10, and a profit of 
10. 
when i tested the problem are: 
1) i have trades that start every time prices are crossing the H or L 
of the 12 candles. So i need to specify to trade only the first time. 
and never open new position in that same day. 
2) i need to transform the stoploss in a trailing stop of 5 point if 
prices are going in direction of the trade. 

Here the formula: 

t=TimeNum() ; 
ref_cand= t > 123000 AND Ref(t,-1)<123000;//so i set a candle 
UP=ValueWhen(ref_cand , Ref(HHV(H,12),-1),1)+4;// max of 12 candels 
before referred for future use 
DN=ValueWhen(ref_cand , Ref(LLV(L,12),-1),1)-4; 
BuyPrice=UP; 
Buy=Cross(H, UP) AND t>123001; 
ShortPrice=DN; 
Short=Cross(DN, L) AND t>123001; 
Sellcover=ApplyStop(0,2,10,1,volatile=False,ReEntryDelay=0); 
ApplyStop(1,2,10,1,volatile=False,ReEntryDelay=0); 

// CLOSE AT END OF MARKET TIME 
x= HHV(TimeNum() ,300)- 600; 
Cover=TimeNum() > x; 
Sell=TimeNum() > x; 
//REMOVE EXCESS Signal maybe not necessary
Buy = ExRem(Buy, Sell); 
Short = ExRem(Short,Cover); 

thank You









------------------------ Yahoo! Groups Sponsor --------------------~--> 
Home is just a click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/