EA using Bollinger bands and RSI

 

Hi everyone,


I am completely new to the idea of coding. I have tried to look at videos and learn it myself, but it will take some time.


I am trying to figure out if the following is possible to be coded:


  1. An EA that works on any time frame,
  2. An EA that works on all currencies,
  3. Utilising the Bollinger Bands at 20,2,0 and RSI at 10,
  4. A position is only entered into, long or short, when the price is outside the SD of 2 and above or below an RSI of 70/30,
  5. If the price continues to move in the opposite direction desired (continues to increase on a short, or decrease on a long position), but is still above/below 70/30 for the RSI, then a further order is made based on the % increase/decrease of the underlying price.
  6. The positions are sold once the RSI moves back below/above 70/30
  7. All positions are calculated on the closing price of the current bar
  8. Once all positions have been closed, due to RSI falling back within 70/30, no new positions can be entered into until the price has fallen back within the bands, and then leave them again. 


I would also like to see one similar to the above, but positions are sold once the price moves back into the bollinger bands.


For example X currency pair is trading at 2.00000/2.00015, and it is below the bands and under 30, then a buy would be placed.

Then the above currency goes down to 1.99985/2.0000, a further buy would be placed, based on the % drop. For example, if it drops another 0.01% then 1 pip, if 0.02 then 2 pip. 

This happens with each new bar.

Once the currency goes back above RSI of 30, positions are sold.

Another version, where once the price moves back within the bands, the positions are sold.


I'd appreciate any advice on this. Maybe it can be done, maybe it can't be. I'm unsure of being able to add further pips on a % basis of the underlying price.


Thanks in advance

 
Samuel Marshall:

Hi everyone,


I am completely new to the idea of coding. I have tried to look at videos and learn it myself, but it will take some time.


I am trying to figure out if the following is possible to be coded:


  1. An EA that works on any time frame,
  2. An EA that works on all currencies,
  3. Utilising the Bollinger Bands at 20,2,0 and RSI at 10,
  4. A position is only entered into, long or short, when the price is outside the SD of 2 and above or below an RSI of 70/30,
  5. If the price continues to move in the opposite direction desired (continues to increase on a short, or decrease on a long position), but is still above/below 70/30 for the RSI, then a further order is made based on the % increase/decrease of the underlying price.
  6. The positions are sold once the RSI moves back below/above 70/30
  7. All positions are calculated on the closing price of the current Tick


I would also like to see one similar to the above, but positions are sold once the price moves back into the bollinger bands.


For example X currency pair is trading at 2.00000/2.00015, and it is below the bands and under 30, then a buy would be placed.

Then the above currency goes down to 1.99985/2.0000, a further buy would be placed, based on the % drop. For example, if it drops another 0.01% then 1 pip, if 0.02 then 2 pip. 

This happens with each new tick.

Once the currency goes back above RSI of 30, positions are sold.

Another version, where once the price moves back within the bands, the positions are sold.


I'd appreciate any advice on this. Maybe it can be done, maybe it can't be. I'm unsure of being able to add further pips on a % basis of the underlying price.


Thanks in advance

Yes it's possible and quite easy to do using MQL
 
Chidera Anakpe:
Yes it's possible and quite easy to do using MQL

Thanks for your quick response!


What sort of command would I be looking at for a % decrease/increase purchase?

 
Anyone able to help out on what type of command would be used, or if this is possible?
 

Hello Samuel,

Even that MQL is easy for coding you have to be a programmer otherwise you will not be able to develop your own EA. If you really want to do this you have to start learning MQL language from the beginning. While you learn the language from the official documentation you will find many examples and you can use them to develop your own EA. 

 
Gyunay Sali:

Hello Samuel,

Even that MQL is easy for coding you have to be a programmer otherwise you will not be able to develop your own EA. If you really want to do this you have to start learning MQL language from the beginning. While you learn the language from the official documentation you will find many examples and you can use them to develop your own EA. 

Ok thanks for your feedback. So you are saying that the above idea is possible to be written in as a code though?
 
Yes of course. Just you have to learn MQL before to develop it as an EA.
 
Gyunay Sali:
Yes of course. Just you have to learn MQL before to develop it as an EA.

Thanks mate. I just wanted to make sure the % drop to purchase could be achieved through coding. Guess I should get started. Fun little side project!


I have started with BB and RSI EA's which seem simple enough, I just don't know what kind of code/instruction would be given for a % base change in the underlying to figure out the amount of pips purchased.


Any help with that area?