Taproum:
Hi, can anyone help to check my code for Bollinger Band MT4? Becos it is not working in the right way. (see in picture).
Did you try swapping these?
if(BandsBreakUp){ if(CanOpenBuy && CanOpenSell && CanOrder){ if (bHasBrokenLowBarrier) OpenNew(OP_BUY); bHasBrokenLowBarrier = false; } } if(BandsBreakDown){ if(CanOpenSell && CanOpenBuy && CanOrder) { if (bHasBrokenHighBarrier) OpenNew(OP_SELL); bHasBrokenHighBarrier = false; } }
Hmm,
- it's NOT your code!
- It is the intention to trade exactly this way:
//+------------------------------------------------------------------------+ //| EA-Bollinger-Breakout-FiverrGig.mq4 | //| Gary Lewis | //| | //+------------------------------------------------------------------------+ #property copyright "Taproum_Test" #property link "www" #property version "1.0" #property strict #property description "This EA will attempt to open orders when it thinks there is a breakout of the Bollinger Bands" /* ENTRY BUY: The price breaks above the top bollinger band ENTRY SELL: The price breaks below the low bollinger band EXIT: Fixed take profit or hit stop loss Only 1 order at a time */
Maybe you better should search for an EA (I strongly assume they exist!) that trades ranges: "Bollinger range" and select CodeBase or
Articles!
Carl Schreiber:
Hmm,
- it's NOT your code!
- It is the intention to trade exactly this way:
Maybe you better should search for an EA (I strongly assume they exist!) that trades ranges: "Bollinger range" and select CodeBase or
Articles!
Hi, check the OpenNew() function if it really has the code to do what you want it to do. If it does, try to split the functions into 2 separate functions. like OpenNewBuy() and OpenNewSell() instead of just one.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, can anyone help to check this code for Bollinger Band MT4? Becos it is not working in the right way. (see in picture).