Forum

How to use Bollinger Bands in EA

Hi, I'd like to use Bollinger Bands when the chart is in trading range in order to get buy/sell signal when a bar touch the lower/upper band. I want to detect if the chart is in trading range by comparing value of upper band or lower band bar after bar to know if its value is stable or not so I

Can we modify extern variables during execution ?

Hi, I'm trying to modify extern variables in the init function but it doesn't seem to be working.. The EA says that variables are modified, but when I check in MT4, extern variables still have its default values :/ Here is my code: double parametres[NPARAMETRES]; int handle; int init() { //----

Using FileReadArray instead of FileReadDouble divide my profits by 10..

Hi, I wrote a function to see profits of each signals I used in my EA, it get those profits in files, and profits change if I use FileReadArray (handle, file, 0, 1) instead of FileReadDouble. I need to use array to write more informations in files, I currently write profits only. So is there any

Problem with File functions

Hi, I'm currently trying to use file functions , with csv files, I create 3 files in the init function and write something, it works, but when I try to write something else later, files aren't modified .. Here is my code: int init() { //---- touched = FileOpen ( "bollinger_touched.csv"

Problem with return..

Hi, Could anyone explain me why this function return 0 whereas the Print just before the return instruction says 1 ? bool resistanceConfirm( int i, int k, double firstPoint, double coeff, bool resistanceConfirm){ static int cpt = 0 ; if ( iClose ( "EURUSD" , PERIOD_H4 , k) <= firstPoint + (i

Problem with OrderClose()

Hi, I'm currently doing an EA which use Bollinger Bands, it sends Buy/Sell Order when I want but I also wanted it to close all Buy/Sell Position when it opened a new Sell/Buy Position, and it doesn't work like it should.. Sometimes, my function sends buy order like it has to, while there is previous

My EA never sends order

Hi, I'm just starting out to use MQL4, and I want to code an EA which would act like the default Moving Average EA of MetaTrader, I have no error when I compile, but it never sends any order when I try it with the Strategy Backtester .. Here is the code: int start() { //---- double MA = 0.0