MQL4 and MetaTrader 4 - page 279

[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
  Adaptive digital filters  (401   1 2 3 4 5 ... 40 41)
Many people now use the JMA and its modifications, but there is almost no mention of the specific theoretical assumptions on which it works. If anyone knows, please share
Hello and sorry for my english. I want to add a pointer to an EA and I need to add code to access the pointer buffer. I include the indicator below //+------------------------------------------------------------------ //| //+------------------------------------------------------------------
hi every one I want to define an extern parameter in an EA and I want put some value on it like: 1 1.1 1.2 1.3 , .... that user can select one of them from DropDownList how I can do it? Best Regards Neda
Hi, I coded a custom indicator, it works fine until new candle opens, after that indicator stops history drawing what's wrong with it??? thanks #property strict #property indicator_chart_window #property indicator_buffers 1 #property indicator_label1 "Slow" #property indicator_color1 Gold #property
Hi everyone, I am a beginner in Mql4 programming. I am creating an EA that can track trades closed by Stop loss or Take profit and use that information to further process the EA for the current trade session. I am thinking of doing this by tracking changes in account balance using AccountBalance()
hi guys i read this part https://docs.mql4.com/files and i try to read a file i use this code for do that but nothing i tryed in all mode possible i think, but probably escape somthing i try also insert relative path directly but noting , how is possible ? string nameFile= "forexsymbol.csv" ;
[Deleted]
Hey there! Something that should be straight forward is giving me an butt-pain. I am trying to make the simplest combobox option with switchable items. And succeeded until it comes to the OnEvent part. So here is my code: #property copyright "me" #property version "1.00" #property strict #property