MQL4 and MetaTrader 4 - page 139

I am writing my own script that submits Forex orders. It seems pretty straight forward, but my MT4 has a live and a demo account. How do I select which account I am sending my Forex order to? I have a Windows program I bought that can submit orders to MT4 based on which account I choose (Live or
Hi everyone. Why does the function IsNewbarOnTimeframe return true when the program is just loaded (at the middle of the current bar)? Why not wait until the current bar (first bar) ends before returning true just like the subsequent bars? How can one code that the function should be false until the
Hello everyone, I have a quick question regarding backtesting in general: Do you know where I can find price data for the different currencies? And how do we know if our data is not falsified? Thanking you in advance, I wish you a great day
Right click chart window > Properties > Common > Scale Fix One to One I assumed this chart feature is new, possibly in the latest 1010 build of MT4.  I have always had issues when I leave my charts unattended, I come back and the market has made a huge move up or down, and the candles are partially...
How to add in ea expert? IN MT4
Hello Everyone, after taking several MQL4 courses online, I'm trying to write my own EA. My EA is a simple MA crossover which opens a short/long position based on MA crossover. It should close the current position on the opposite signal and open a new position. I wrote the code, tested it and it
256 divided by 5 is 51.2, but MT4 gives me 51.00000000. int OnInit () { Average = ( 256 / 5 ); drawLabel(); return ( INIT_SUCCEEDED ); } double Average; void drawLabel() { string name = "LabelDebug" ; string text = "Average: " + DoubleToString (Average, 8 ); if ( ObjectFind (name) !=
It's easy with preset colors: ChartBkg = ChartSetInteger ( 0 , CHART_COLOR_BACKGROUND , White); ChartBkg = ChartSetInteger ( 0 , CHART_COLOR_BACKGROUND , Lavender); What about custom colors? Manual selection returns something like 181,230,210. But these don't work: ChartBkg = ChartSetInteger ( 0
Hi, I am trying to create Moving Average color. When moving average is Increasing relative to previous bar - it is Blue color. When moving average is Decreasing relative to previous bar - it is Red color. I created 2 buffers and initialize them at OnInit function SetIndexBuffer ( 1 ,Uptrend); //
Hi all, I have the following simplified code: bool init_; int OnInit () { init_ = true ; //--- return ( INIT_SUCCEEDED ); } int OnCalculate ( const int rates_total, const int prev_calculated, const datetime &time[], const double &open[]
Hi there i wanted to know how can i get the users pc mac address
I would like to include a similar type of object drawing on my charts for my EA so I can visually track when and where it opened and exited trades... anybody has or know where to find the code strategy tester is using?
This is really easy to do in TradingView – under the indicator options I can right click and say "Move to New window Below", and it pops into its own window beneath my chart. How do I do this same thing in MT4
Hello, I have a custom indicator that I made but for some reason the push notifications aren't coming through my phone, however I get the alerts on my computer. Can someone please fix this? This is the source code: //------------------------------------------------------------------ #property
  Writing free EAs  (156   1 2 3 4 5 ... 15 16)
Hi all, in this thread we share trading ideas and write free EAs
Hello I got " unknown ticket orderdelete funtion " error to close pending orders //======== void CloseAll( int t) { int cnt= OrdersTotal (); int ticket= 0 ; double closeprice= 0 ; double closelot= 0 ; int ordertip=- 1 ; for ( int
Hi everyone, I'm trying to make this indicator like the image but no success Could anyone help me please
  Data Discrepancy  (3)
Hi, I am working on and EA which uses AI to take a trade. The problem I am facing is that the data I used to train the AI not matches up with the live broker account I am using. I have tried matching the data with following brokers: 1. Oanda 2. Forex.com None of the above brokers provide historical
here is indicator code // modified by banzai // July 13th, 2020 // not for sale, rent, auction, nor lease // I copied the code from Mr. Tools. Thank you. #property copyright "Copyright 2016, mladen - MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00"
Hi every one what's problem on following cod for finding pervious day high?!! double High = NormalizeDouble ( iHigh ( _Symbol , PERIOD_D1 , 1 )+(percent*Bid), Digits ); //prev Day High its work properly on tester but in live chart it tack 2 day before high !! note : on opening stocks market
Hi everyone, I want to make a drop down list with the option of yes and no. I need 2 enum with those option. Since enum can't have duplicate data, is there's another way to have 2 drop down list with yes and no option
Hi Guys, Im tring to create an indicator to draw an arrow with a buffer on the chart for when the price crosses above the high or low of the previous day. but cant seem to get it to work, what am i doing wrong? Many Thanks in advance #include <stdlib.mqh> #include <stderror.mqh> //--- indicator
Here it is I used the example from knowledge base here .. but application does not produce good result, only some nonsensical number, see below  What do I do wrong    Example from MQ5 -------> double val=iCustom(NULL,0,"SampleInd",13,1,0); Here I am trybing ------>  double LAG1=iCustom(NULL,0...
  Renko  (9)
Hello guys! So I have this renko indicator and the thing is , that is printing renko bars after 1 minute candle is closed ( on chart from where is taking signal from). So, for example, if I set 50 points renko bars, I would expect that a renko bar is printed when the price traveled 50 points. But
Greetings. I'm trying to access the results of the chart " Optimization Result " when i run a test. I don't really know how to use onTester(), as I can create messages, alerts, sounds, nor change variables. I dont really know when and how its called. What I need to do is get the pass of
  ACD method  (13   1 2)
Has anyone looked at the ACD method in the book by Mark B. Fisher ? is there any MT4 code here for it ? Thanks
here is indicator here is indicator //+------------------------------------------------------------------+ //| HMA color nrp.mq4 | //| mladen |
I have a script to extract historical data and 12 indicators to a csv file for analysis purposes. On the other hand I have an expert advisor which uses the same 12 indicators as input, so it calculates them as soon as a new bar is closed, over the open prices. Both the script and the EA use the...
I coded an expert advisor in mql4 for a client, I deliver it and he tells me that nothing works, in disbelief I try to download his broker and test it and I find that in fact the broker messed up the operations, I compile the code and delete the cache file in the expert advisors folder, once this is
hello, how can i make a candle bar offset with an trendline currently used (ObjectCreate(0,name,OBJ_TREND,0,iTime(_Symbol,PERIOD_CURRENT,startPaintingCandel),nextLowPt,iTime(_Symbol,PERIOD_CURRENT,0)+5*60,nextLowPt but this only extends 5 minutes in the future thank you