# How to combine formulas in amibroker.

I

#### indiabulz

##### Guest

I have newly devised a trading system that perfectly fits my intraday trading needs and gives upto 95% accurate signals. But the problem is, i have to run multiple scans with 3 different formulas, which consumes a good deal of time.

Can anyone suggest me the method to combine all the 3 formulas in one single scan. Would it require re-programming using AFL. If yes then how. For eg. How do i combine RMO, MACD crossover and RSI, all in one formula.

Plz suggest me as per you experiance and knowledge. Any help in this regard would be grateful to me. Thanks a lot.

Another off-topic question:

Thanks again!!!

#### nagarjuna13

##### Member
Just check this example for bullish engulf pattern.

Buy = Close > Ref( Open , -1 )
AND Open < Ref( Close , -1 )
AND High > Ref( High , -1 )
AND Low < Ref( Low , -1 )
AND Ref( Close , -1 ) < Ref( Open , -1 )
AND Close > Open;

Sell = 0;

Short = 0;

Cover = 0;

Similarly, you use "AND" between your formulas and you need to use braces around each of your formulas. AFL supports unlimited number of braces.

thank you
nagarjuna

#### MarketRider

##### Active Member
If your system gives 95% accurate results(?) ..why not buy amibroker which costs just Rs. 14000/- ...any trader should have funds for a trading account , good RT data feed and a good charting software first..then start trading....:thumb:

#### sahil79

##### Active Member

I have newly devised a trading system that perfectly fits my intraday trading needs and gives upto 95% accurate signals. But the problem is, i have to run multiple scans with 3 different formulas, which consumes a good deal of time.

Can anyone suggest me the method to combine all the 3 formulas in one single scan. Would it require re-programming using AFL. If yes then how. For eg. How do i combine RMO, MACD crossover and RSI, all in one formula.

Plz suggest me as per you experiance and knowledge. Any help in this regard would be grateful to me. Thanks a lot.

Another off-topic question:

Thanks again!!!

Hi Indiabulz, feeling nice to know that ur well devised afl is giving the result of 95% for intra, can u share it for us so that we can try it as well.
regards
santosh

#### singhboy

##### Active Member
Santosh, u should get from reading his post that he buys when RMO givs buy signal, macd crossover happens n RSI turn up from oversold region n price going up. Now the afl, haha he requesting himself, how will he give u. Let me try if i could help u

SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2))/10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);
x=RSI(14);
y= MA( RSI(14),9);

OR
(Cross(x,y)
AND RSI(14) >45)
OR
Cross ( MACD(), Signal() );

I

#### indiabulz

##### Guest
Santosh, u should get from reading his post that he buys when RMO givs buy signal, macd crossover happens n RSI turn up from oversold region n price going up. Now the afl, haha he requesting himself, how will he give u. Let me try if i could help u

SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2))/10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);
x=RSI(14);
y= MA( RSI(14),9);

OR
(Cross(x,y)
AND RSI(14) >45)
OR
Cross ( MACD(), Signal() );
Thanks Mr.Singh for your reply to my Post. And yes you rightly guessed my Trading system. After a great deal of trial and error i suceeded in devising a trading system for intraday. The logic is simple. Osciallator + Mometum Indicator + Volume Indicator = Perfect signal. For this i use RMO, MACD and RSI.

It works this way, Trend + Momentum in the direction of trend + Volume to support the trend = Enough time to Enter/Hold/Exit. I use a 1 minute Intraday chart. This system does not work on friday. Rest days, its performance is excellent. Anyway, i would not like to disclose MACD and RSI parameters for some reasons. You can customize the parameters which suits your risk management.

Thanks!!!

#### shuttle

##### New Member
I Want make combination of 6 ready AFL( No indicator) at a time. Can it possible? If Possible, Pls give me the instructions.

#### jagankris

##### Well-Known Member
Santosh, u should get from reading his post that he buys when RMO givs buy signal, macd crossover happens n RSI turn up from oversold region n price going up. Now the afl, haha he requesting himself, how will he give u. Let me try if i could help u

SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2))/10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);
x=RSI(14);
y= MA( RSI(14),9);

OR
(Cross(x,y)
AND RSI(14) >45)
OR
Cross ( MACD(), Signal() );
Mr.Singh,

I guess the formula should be replaced with "and" instead of "OR".
Please let me know if it is otherwise.

Regards,
JK

#### jagankris

##### Well-Known Member
Thanks Mr.Singh for your reply to my Post. And yes you rightly guessed my Trading system. After a great deal of trial and error i suceeded in devising a trading system for intraday. The logic is simple. Osciallator + Mometum Indicator + Volume Indicator = Perfect signal. For this i use RMO, MACD and RSI.

It works this way, Trend + Momentum in the direction of trend + Volume to support the trend = Enough time to Enter/Hold/Exit. I use a 1 minute Intraday chart. This system does not work on friday. Rest days, its performance is excellent. Anyway, i would not like to disclose MACD and RSI parameters for some reasons. You can customize the parameters which suits your risk management.

Thanks!!!
indiabulz,
I don't see any volume indicator used in the above logic.

Best Regards,
JK

##### Member
Santosh, u should get from reading his post that he buys when RMO givs buy signal, macd crossover happens n RSI turn up from oversold region n price going up. Now the afl, haha he requesting himself, how will he give u. Let me try if i could help u

SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2))/10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);
x=RSI(14);
y= MA( RSI(14),9);