This little and simple code allows you to draw an indicator, which show you when buy or sell conditions are met.
For “buy” conditions, I did just set :
close > MM200
close > Parabolic SAR
MACD > 0
RSI14 > 50
For “sell” conditions : the opposite.
Of course, you can set what you want, in order to test your strategies.
Of course, to be profitable, you must also set your trading rules (entry, stop loss, trailing stop, take profit, etc.)
It’s only an indicator, which doesn’t show entry or exit rules.
You can test it with a trailing stop, it seems too be profitable !
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
ACHAT = 0 VENTE = 0 PSAR = SAR[0.02,0.02,0.2] c1a = close > PSAR c1v = close < PSAR MM200 = Average[200](close) c2a = close > MM200 c2v = close < MM200 IndicMACD = MACD[12,26,9](close) c3a = (IndicMACD >= 0) c3v = (IndicMACD <= 0) RSI14 = RSI[14](close) c4a = (RSI14 >= 50) c4v = (RSI14 <= 50) IF c1a AND c2a AND c3a AND c4a THEN ACHAT = 1 ENDIF IF c1v AND c2v and c3v AND c4v THEN VENTE = -1 ENDIF RETURN ACHAT as "ACHAT", VENTE as "VENTE" |
In order to have the same, you must go to “properties”, and set “achat” and “vente” to histograms (and set the colors green and red), add an horizontal line (value 0).
Happy trading !
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
I tried applying this indicator, but i get a different look – can you help me get the same green and red line as in the picture above?
Thank you for your help
Kind Regards
Rikke
Hello,
You simply set “histogram” to the indicator, and then set color to green or red.Tell me if you need help 😉
Sorry yes I do. i don´t know where to set it? I asked the prorealtime support where to find the “properties”, but they didn’t know.
Thank you
Hi again – i found out how to make the histogram – but i don´t know how to get the dottet green/red lines on the chart?
Sorry again – i am new to this.
and the indicator is only aplied for a week or so? Like in a certain interval of time.
and the indicator is only aplied for a week or so? Like in a certain interval of time.
Can you explain this?
and when i change the time from 30min till for exampel 2 hours the “red” part of the histogram disapear?
I really like this indicator to work – i think it is good. But i dont know how to code and so on.
sorry and thank you for your help.
Is it possible to reach you on the telephone?
Hello,
Don’t ask so much questions, I will answer !
You just click “properties”, and set to histograms.Then, you can change the color by clicking on it.
The dotted line is simply the “Parabolic SAR”, you have to insert it on your chart.
The indicator is applied for every timeframe. If it disappears on another timeframe, it is because there are no opportunities / criteria.
Don’t forget to zoom on data history (for example, set it on 10,000 units of H1 timeframe)Best regards,
I think it is working when i set the time for “daily”
Thank you for all your help – I am sorry for all the messages, but i solved my problems by experimenting with the settings, and i didn’t want to waste your time when I had found the solution. Do you think it is possible to make an automatic trading strategy of this indicatior?
I went to this website in the first place because i needed help making another quite simpel trading strategy. But i dont know how to do the coding. Is it something you could help me with? I dont know the prices but i suppose it depends on the difficulty of the code.
Kind regards
Rikke
Hello Rikke, for custom programming needs, you can fill the form on this page : http://www.prorealcode.com/trading-programming-services/
@ Rikke,
Beware of such an indicator. It’s just an indicator, not a trading system.
You can fill the indicator with any conditions you want (for sell or buy). If you use this indicator just as a trading system, no doubt it will fail.
You must use it with your own strategy, money management, rules, other indicators, price action, etc.
Regards,
Hello, All.
Can anyone inform me how the above binary indicator or any similar indicator code can be modified to show only the first “long” and first “short” histogram bar on each change of state?
Regards
Peter
Hola, me gustó mucho este indicador. Pero, a la hora de instalarlo me da error en la línea 4 y 8. En la línea 4 da error en la coma del 0,02 y en la línea 8 el error me lo marca en el ( . Me gustaria saber que puedo hacer para corregirlo. Gracias