MQL4 and MetaTrader 4 - page 298

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
Hi I have an custom EMA that calculate daily HLC/3 as its applied price I get the error " array out of range when it's initializing, then the error disappears when I change the time frame Thank you! datetime time1[]; ArrayCopySeries(time1,MODE_TIME, NULL , PERIOD_D1 ); for (i= 0 ,y= 0
hi guys i try to search in array bidimentional a string but return me error 'ArrayBsearch' - no one of the overloads can be applied to the function call why ? int start() { string nameFile= "forexsymbol.csv" ; string terminal_data_path=( TERMINAL_DATA_PATH ); string filename=
hi every one I use comment to show some text in chart: Comment ( "\n" , "%Risk: " ,Risk , "\n" , "Lot: " ,Lot , "\n" , "ATR: " ,Atr , "\n" , "SL: " ,SL, " pips" , "\n" , "Spread: " ,SL2, " pips" ); I want it shows RISK
Hey guys, Does anybody have a function that increases the lot size by a certain amount when the account balance increases by a certain amount. Eg. If the account is initially on $2000 I want it to trade on 0.2 and when the account balance reaches $3000 it must start trading at 0.3 etc. Thanks! 
for ( int i=pos; i>= 0 ;i--) { if (RSI_current_peak[i] != EMPTY_VALUE ) { int count = 0 ; for ( int k = i+ 4 ; k <= pos; k++ ) { if (RSI_current_peak[k] == EMPTY_VALUE ) { count = count+ 1 ;
This program actually copies and pasts vertical lines as intended but original date is different from paste date by up to 10 seconds. Why is that? Thanks in advance. int OnInit () { ChartSetInteger ( 0 , CHART_EVENT_OBJECT_CREATE , 1 ); return ( INIT_SUCCEEDED ); } void OnChartEvent ( const
hi everyone i have a custom inidcator as you see here it totaly works fine in live chart or tester but when i call it with iCustom it dosen't work right and always show the empty value 2147483647.0 the ea is very simple just calling the dType value from custom indicator and if it was 1 a buy will be
Hi I wanted to programmatically check in MQL4 if I have upward trend or downward trend which is 1 set of higher high and higher low (long) and 1 set of lower high and lower low. I tried to use zigzag indicator but cannot dynamically get values of the tips of the lines. Ideally I want to store values