MQL4 and MetaTrader 4 - page 277

Hi. So I've started to test and see if I can use a bought Indicator as a trigger for my EA. I can get the EA to work with all the Indicators buffers if i just dont count for all the inputs in the code. double PFTP_BuySignal = iCustom ( Symbol (), PERIOD_CURRENT , "Market/Payed/PipFinite Trend PRO"
Hi all, I am having difficulties with my code. I would like it to open one order per currency pair but currently it only opens one order for the whole platform, can anyone guide me as to how i could adjust my code to open one trade per currency pair. this is what i have currently got going, if
  candle width set  (2)
Who can help? In chartsetinteger, which function is used to change the width of the candle? thank you
Is there a way to cast or convert from a string to an ENUM. This is a simplification of the problem: enum ENUM_OPS {   BUY = 1, SELL = 2};string sVal = "BUY";ENUM_OPS eVal;//eVal = (ENUM_OPS)sVal; //Doesnt works//eVal = EnumToString(sVal); //Doesnt works Which is the proper way to assign sVal to...
hi guys i try to read in MT4 a Memory mapped file , i look this example https://www.mql5.com/en/forum/142721 i have created a C# memory mapped file this is a code using System; using System.IO; using System.IO.MemoryMappedFiles; using System.Threading; class Program { // Process B: static
I cannot understand why the program skips the lines after a successful previous line and ignores the instructions on those lines. If you look at the code below you will see that there is a Sell transaction that is carried out successfully in the Strategy Tester , but the Sell transaction is never
HI Experts I am new to MQL4 Programming, and trying to learn it, while writing my own EA, I am trying to access the EA common parameters which are shown when you attach an EA to a chart (as shown in screenshot), specially for positions, like if someone had set to open positions for Long only, I want
Dear MQL, Are there any plans to enable MetaTrader 4 to be used across multiple computer screens simultaneously? My MT4 terminal appears so cluttered on the one screen, and I would like to separate the chart window from the Terminal (trades) window ie. one computer monitor for the chart, the second
Hello, I am new to programming and I am trying to learn. I get an array out of range error, can someone please tell me what I am doing wrong. #property copyright "Copyright 2020, YarnnyArmy" #property link "https://www.mql5.com" #property version "1.00" #property strict int LowerFrac_1; int
void OnTick()  {   MqlTick last_tick;//---   if(SymbolInfoTick(Symbol(),last_tick_flag))     {      Print(last_tick.flag,": Bid = ",last_tick.bid,            " Ask = ",last_tick.ask,"  Volume = ",last_tick.volume);     }   else Print("SymbolInfoTick() failed, error = ",GetLastError());//---  } I...
Hi everyone, I have just switched to MQL4 coming from MQL5 only to be shocked by few things that's MQL4 limited to. For example the limitation of viewing charts in the usual Timeframes of MQL5, and having to go around that with using the Period Converter. Which is not bad, but i don't understand why
All, This one is driving me nuts! whilst trying to write an EA to trade the DAX I've discovered several instances of missing candle data or periods where the market is closed during the night. I'm using the ' iclose ' to determine a close level from the previous day, but this requires a 'number of
I have installed a vps from MQL5 in my MT4 platform for one signal. My question is if this vps is also applied for another subscribed signal, or is it necessary to buy a new vps subscription for that new signal
Hi, I’ve created an EA that will do partially close order if certain condition met. The first condition would be closing half of the open order, I use it using orderlots()*0.5 . For the second condition I use only orderlots() to close all the order. The problem Is that I got an error 131, I thought
How can I call the chart id of the current chart
[Deleted]
i have Ea i wrote a EA and would like to add script to it so that i can input a % of the balance to use in buying lots. So $1000 could have a lot size of 0.1 and then increase it to 0.2 when the balance is $2000 and between those amounts? but i would like to be able to change the settings of the %....
I've got this function which i don't know why it doesn't  work. I want the EA to place a buy order is last closed  sell trade was a loss. double LastS(){double ProS = 0;       for(int i=OrdersHistoryTotal()-1; i>=0; i--)         {         if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) ==...
void checkprofit() { double dblProfit=0; int POS=0; bool boolTerm=false; while(boolTerm==false)                   {//4-2-1        if(OrderSelect(POS,SELECT_BY_POS))                     {//4-2-2          if(OrderMagicNumber()==magicnumber) dblProfit=dblProfit+OrderProfit();          POS++;...
Hello. I'm beginner.  I want to give an event when Current bar is closed and create next bar. How do I know when the current bar is closed ? Thank you.
Suddenly, I cannot backtest the expert. It opens 1 order and it does not continue. Do any of you know why could this be
What is a good example code of how to use ENUM_TIMEFRAME, PERIOD_CURRENT, Period() and _Period? Can I check the timeframe of the current chat by writing the following? if (Period() == ENUM_TIMEFRAME) Bla bla bla or if (ENUM_TIMEFRAME == PERIOD_CURRENT) Bla bla bla Both examples are giving me
MQL4 documentation states that the value limits for double type variables is: "Minimal Positive Value" = 2.2250738585072014e-308 "Maximum Value" = 1.7976931348623158e+308. (See https://docs.mql4.com/basis/types/double) So why does StringToDouble alter the value converted? Or am I doing one thing
Hi Erveryone, I am new to MT4 programming, and just try to learning and creating my own EA with my logic, and for that I needed to calculate Fibo levels between 2 assigned prices, I tried to search a lot, but I couldn't find an inbuilt function or class, though I found some OBJFIBO but couldn't
Please explain what this value is after the extern string in my AE (in a circle). I would like to add an indicator to my EA and I do not know if the value after the extern string can be anything or is it assigned to something? I will be grateful for your help AlgoEA
hi guys , i have in folder FILE this txt, 2016.txt , i want , when people find 2015.txt return simply error, for do that i use this code int YearCtrl = 5 ; Print ( "I ANNI SONO QUESTI--- " + (Year()-YearCtrl)); string Anni=( IntegerToString ((Year()-YearCtrl))+ ".txt" ); long
What about the second highest? or the third? My guess is, for example, get Ihighest for say.. 100 candles, if the highest is candle 10, then I would need to get iHighest from 1 to 9 and then iHighest from 11 to 100, compare the 2 new values and obtain it that way. Is there any other way to get the
I am looking for insight on how to use API's to put a license key inside of the Expert Advisor settings to basically "lock" the trader until their key is verified by their subscription on our other platform. How does a developer do this and what kind of programming am I looking at here? Would it be
Hi, I'm having an issue where the mt4 platform (pc version) sometimes drops algos that I've been working on from the chart. Sometimes I'm believing it's from some kind of arithmetic error (tinkering with arithmetic for iMA values and arrays), but when I change the code back and run it again it keeps
I made a purchase on MQL5.com and then when I tried to get this purchase on my MT4 account, I kept getting an authentication error... Can someone please help me
Hello house, I need some one to code an EA where a profitable order in profit is used to close the same amount of loosing order in negative to reduce draw down