Forum

Martingale EA

A few days ago I received a PM to code an EA with the following parameters: -User decides initial trade direction (let's say long) and starting lot size (say .1 lot) -New position would be added every time the market moves x pips (say 10 pips) up or down away from the most recent position taken. If

Collection of useful MT4 functions for coding

Hello all, I thought it would be cool if there was a thread that shared useful functions people have coded. I find it can be much easier coding EA's if you have a useful toolbox of coded functions to work from. I'm wanting to share some functions I have coded and found useful, and am hoping others

Random Number Generation

Hello all, I was wondering if anyone knew a good way to code a random number generator ? I understand I could use the MathRand() function, but this function will return a random number anywhere between 0 - 32767. What I need to do is generate a random number between two parametars, x & y. An example

Closed Trade History EA / Indicator

I decides to try and create a tool to display closed order history. Actually, the idea came from another member, ElectricSavant. (Good Idea ES!) Much easier than manually scrolling through your Account History tab. This "indicator" is actually an EA. The EA does not generate trades, it simply reads

Multiple mt4 broker communication?

Hello everyone, I have scoured the internet trying to figure out how to make multiple (separate broker) mt4 platforms read and write to a universal shared file. This shared file would not reside within the mt4 platform framework, but be an external application. I would like this file to receive real

Does anybody know how to do this?

Here is what I'm trying to code: I have a chart with an RSI attached to it. Then I drag and drop a MA into the RSI window and choose apply to "previous indicator's data". Now my moving average is using the RSI values for it's calculations. I can't figure out how to code this into an EA. The

Driving me crazy

I'm trying to call the custom indicator CC_1. (attached) Here's my code: CC_USD=iCustom(NULL,0,"CC_1",0,0); Print(" CC_USD =",CC_USD); CC_EUR=iCustom(NULL,0,"CC_1",1,0); Print(" CC_EUR =",CC_EUR); CC_GBP=iCustom(NULL,0,"CC_1",2,0); Print(" CC_GBP =",CC_GBP); CC_CHF=iCustom(NULL,0,"CC_1",3,0);

Has anyone got this error?

I was wondering if anyone has received this error in MetaEditor: 'p13p11' - internal stack overflow-simplify the program, please p13p11 is an int. in my program (one of many). Does anyone know how many integers you are allowed to define in mq4? I guess I have too many variables. Is there a way to

Looking for an indicator

I am looking for a moving average-type indicator. This is the idea: The MA would plot on the current bar (maybe above or below the bar) the AVERAGE TICK VALUE of every tick value that came in on the previous bar. This would be different than the avg of high+low/2 or the high+low+close/3. For