AFL Coding help

Hi all, I am a newcomer in AFL Programming and here is a question to ask. :smile:
I would like to ask how to combine two signals with two distinct applystop functions in one formula?

For example:
(Signal1)
Buy 1 =......
Sell 1 =......
Short1 =......
Cover1 =......

Applystop1 for signal 1 only

(Signal 2)
Buy 2 =......
Sell 2 =......
Short2 =......
Cover2 =......

Applystop2 for signal 2 only

My aim is that these two signals can function independently so 2 contracts will be bought if they occur at the same time (and buy 1 contracts only if only one signal occur)

Please help :slight_smile:

@ckleung - See How-to-use-this-site.

In short you just modify the amount in ApplyStop function call

Buy1 = ..
Buy2 = ..
Buy = Buy1 OR Buy2;
Amount1 = 5;
Amount2 = 10;

ApplyStop( stopTypeLoss, stopModePercent, IIf( Buy1, Amount1, Amount2 ), True );

See also: http://www.amibroker.com/kb/2014/09/24/how-to-identify-which-signal-triggers/