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

[amibroker] Tricky Apply Profit Code



PureBytes Links

Trading Reference Links

I've like my system to generate an applystop type of stop 
whenever the "StpProfit" condition in the following exploration 
returns a value of 1. 

I've put together the following code to illustrate - it works ok but 
I'm not sure how I would code the Applystop to equate to the value 
whenever a certain condition is met: ( Current High exceeds EMA( H, 
13 ) + (Pd1 /100) * ATR(10);  ( but previous bar did not.  )

I could also use a sellif type of statement to say sell if the 
high "tags" the ATR line but again I'm lost on the code and I'm not 
aware of any sellif functions avaialable in AMI.


Pd1 = Optimize("Pd1",150,100,300,25);
ProfitTaker = EMA( H, 13 ) + (Pd1 /100) * ATR(10); 
StpProfit = IIf(H - ProfitTaker > 0, 1, 0);

Filter = Open == Open;

AddColumn(C,"Close  ",1.2);
AddColumn(H,"High  ",1.2);
AddColumn(ProfitTaker,"ProfitTaker  ",1.2);
AddColumn(H - ProfitTaker,"H - ProfitTaker  ",1.2);
AddColumn(StpProfit,"StpProfit  ",1.0);

Could I use a variable like valuewhen StpProfit = 1 for example.

As always any ideas really helpful and much appreciated.

Regards,


Dean Hodgins

  





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/DldnlA/9M2KAA/U1CZAA/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/