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

[amibroker] Plse help! APPLYSTOP() and BUYPRICE, SELLPRICE



PureBytes Links

Trading Reference Links


Hello!

some days ago I asked for help, how to use APPLYSTOP() to turn a 
position when a CLOSE crossed a certain stop which is defined as a 
price. It looks like this is not possible!? 

So I thought I could use the difference between the payed price and 
the stop-price and use APPLYSTOP() with Mode=2(stopTypeLoss) type=2( 
amount in points) amount=calculated difference in points. 

Would someone confirm this is the right way to do?

For the payed price I would use arrays BUYPRICE and SELLPRICE, but I 
have found out, they are exactly similar to the OPEN price of the 
day (or bar) the buysignal occurred. Even I set SetTradeDelays( 1, 
1, 1, 1 ) ; Why does BUYPRICE and SELLPRICE not reflect the real 
payed price? Do I have to create correct BUYPRICE and SELLPRICE 
arrays by myself?

Thanx for any suggestions,

enzo






--- In amibroker@xxxxxxxxxxxxxxx, "enzo" <herrfrechdax@xxxx> wrote:
> 
> Hello usergroup!
> 
> In my AITM trading-system buy- and sell-signals are generated at 
> CLOSE and executed at next open. Stops are set at the last 
> SwingHighs/-lows before the signal occurred. Those SH/SH´s are 
> written in an array "StopPriceArr". A close beyound/below a stop 
> should turn the position and be executed at next open. 
> Can someone help me to code the stops?
> 
> 
> So far I coded:
> 
> SetTradeDelays( 1, 1, 1, 1 ) ;
> SetOption("ActivateStopsImmediately",True); 
> .
> .
> .
> BUY=BuyCondition;
> SELL=SellCondition;
> ApplyStop(0,2,StopPriceArr,2);
> Short = Sell;
> Cover = Buy;
> 
> 
> It seems it is not working as I expected and actually I am not 
> surprised by it, cause I cannot make a sense of the combinations 
of 
> ApplyStop-paramaters.
> 
> Can you?
> 
> Thanx in advance
> enzo





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/