Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

RF Mello for Amibroker (AFL)

Rating:
2 / 5 (Votes 5)
Tags:
trading system, amibroker, exploration

This setup has small targets. You can optimize it. We have large number of winning trades.

Screenshots

Similar Indicators / Formulas

20 Day High Breakout
Submitted by ashokram1 about 13 years ago
Range Constriction
Submitted by davidh about 13 years ago
BULLISH SCAN
Submitted by moon over 11 years ago
Three Line Net Bar And Tendency
Submitted by moapereira about 14 years ago
2 Day RSI filter/buy
Submitted by davemmm over 14 years ago
Hilbert study
Submitted by realkaka over 14 years ago

Indicator / Formula

Copy & Paste Friendly
// RF Setup by Mello



_SECTION_BEGIN("Price");

SetChartOptions(0,chartShowArrows|chartShowDates);

SetBarsRequired(sbrAll,sbrAll);

SetBarFillColor(IIf(C>O,ParamColor("Bar Up Color", colorBrightGreen),IIf(C<=O,ParamColor("Bar Down Color", colorRed),colorLightGrey)));

Plot(C,"Close",IIf(C>O,ParamColor("Shadow Up Color", colorWhite),IIf(C<=O,ParamColor("Shadow Down Color", colorWhite),colorLightGrey)),64,0,0,0);

SetChartBkColor(ParamColor("Panel Color ",colorDarkGrey));

SetChartBkGradientFill(ParamColor("Upper Chart",colorDarkGrey),ParamColor("Lower Chart",colorDarkGrey));

GraphXSpace=Param("GraphXSpace",20,-10,25,1);

//SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

 

_SECTION_BEGIN("Cálculo EMA");



prd01 = Optimize("Periodo", 9, 5, 34, 2);
EMA17 = EMA(C,prd01);
Cond1 = IIf(EMA17 >= Ref(EMA17, -1), 1, 0);
Plot( EMA17, "EMA17" ,ParamColor( "Color1", colorRed ), ParamStyle("Style", styleDashed|styleThick) | styleNoRescale );

_SECTION_END();



_SECTION_BEGIN("Cálculo RF");


Cond2 = IIf(Ref(Close, -3) < Ref(Open, -3), 1, 0);
Cond3 = IIf(Ref(Close, -2) > Ref(Open, -2), 1, 0);
Cond4 = IIf(Ref(Close, -1) < Ref(Open, -1), 1, 0);

Cond5 = (Cond2 + Cond3 + Cond4);

Cond6 = Cond1 + Cond5;

precomax = Ref(HHV(H,3),-1); 
Precomin = Ref(LLV(L,3),-1);

Resistencia = ValueWhen(Cond6 ==4 , Precomax, 1);
Suporte = ValueWhen(Cond6 ==4 , Precomin, 1);
Distancia = ValueWhen(Cond6 ==4 , precomax - Precomin, 1);

alvo1 = Optimize("alvo1", 1.5, 1,3, 0.2);

Alvo = resistencia + (distancia * alvo1);


_SECTION_END();



_SECTION_BEGIN("Comprar/Vender");




Buy = Cond1 == 1 AND Cross(High, Resistencia);

BuyPrice = Resistencia ;
Preco = ValueWhen(Buy, resistencia, 1);
Venda = ValueWhen(Buy, alvo, 1);
Stope = ValueWhen(Buy, Suporte, 1);
Sell = Cross(High, Venda) OR Cross(stope, Low);
SellPrice = IIf(Cross(High, Venda), Venda, stope);

Buy=ExRem(Buy,Sell);

Sell=ExRem(Sell,Buy);


shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

PlotShapes(shape, IIf(Buy,colorGreen,colorRed), 0, IIf(Buy,Low,High));

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-5);

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-10);

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-7.5);

PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=10);

PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=15);

PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-12.5);

Plot(Venda, "Target", colorGreen, styleLine, Null, Null, 0, 0, 1);
Plot(Stope, "Stop", colorRed, styleLine, Null, Null, 0, 0, 1);
Plot(Preco, "Compra", colorWhite, styleLine, Null, Null, 0, 0, 1);




 

 

 



AddColumn( Buy, "Buy", 1);

AddColumn(Sell, "Sell", 1);

AddColumn(Close,"Close",1.2);

AddColumn(Volume,"Volume",1.0);

 

 



 // trade size: 100% of current portfolio equity
SetPositionSize( 5, spsPercentOfEquity );

8 comments

1. Divyesh

Nice code….!!

excellant results with 15 min TF and after modificaton……!!!

Thanx alot Mello Treader………….!!!

XXX

2. TNSuresh

Ln 98,99,100 error. pls guide me.

3. shariful

really good one thank to the coder ..@ TNSuresh, where saying “to much argument” delete one zero out of two..

4. TNSuresh

thanks shariful

5. mediaworks

Error 16 too many arguments error.ln 106 col 64. help

6. smartsan

Hi Mello,

Cooud you give us an explanation about your setup?

Thanks in advance.

7. rob hoot

Nice afl but it seems that the formula references FUTURE quotes.
If you backtest this system you may receive outstanding results
that CAN NOT be reproduced in real trading.

8. MelloTrader

This afl can be improved. I do not have much knowledge about Amibroker programming. Basically this setup is based on observing 3 candles:
Situation 1 – Red (open > close) + Green (close > open) + Red (open > close)
and EMA higher than previous candle ==> BUY price cross highest this formation or
Situation 2 – Green (close > open) + Red (open > close) + Green (close > open)
and EMA lower than previous candle ==> SELL price cross lowest of this formation(not included in this afl).
The Target between 1-3 times the amplitude of this formation as much in order BUY or SELL mode.
Appearing the condition 1 and with the EMA continues upping, the purchase point does not change and can happen after several candles.
Appearing the condition 2 and with the EMA continues downwing, the selling point does not change and can happen after several candles(not included in this afl).
Suggestions for improvement in this setup are welcome.
Setup to be worked on frames exceeding 60 minutes

Sorry my English, I hope to help you.

Leave Comment

Please login here to leave a comment.

Back