MQL4 and MetaTrader 4

To post a new topic, please log in or register
The MetaTrader 4 update will be released on Friday, January the 24th, 2020. The update provides bug fixes and stability improvements. The new version will be available through the Live Update system
  On Arrays (2)
If you populate an array via a for loop from another indicators offset values (starting with 0), something like: double TestArray[]; for(i = 0 to 9) { TestArray[i] = Indicator(Symbol(), PERIOD_1HR...., i) } Is it already in the correct order to use any of the IndicatorOnArray functions ? or do you
Hi I have a trailing stop on my winning trades that works very well. Is it possible to have a similar trailing stop on losing trades rather than a hard stop loss. Can the stop loss be adjusted/ decreased as the price moves in my favor? Here is the code for my trailing stop loss on winning trades
Hi guys I am starting to get familiar with mql4 EA but I am stuck at a certain point. It would be great if I could get some support. I writing a script for EA and couldnt get past this point. I am checking for conditions in daily chart and if it is successful i want to check another set of
hi guys itry to set the time frame when i attach a script with this code but not work ChartSetSymbolPeriod ( 0 , NULL , PERIOD_M30 ); anyone can help me ? thankz
Dear Forum, I've been struggling to read the attached SSRC indicator values without success for days. The value returned by my code is different from what is displayed in the Data Window with same timeframe as the code. For some unknown reasons, the three values are the same and different from the
hello, i'm trying to code an indicator derived a alert on next candle as previous candle mean if current candle in green to send a alert as buy in next candle and if last candle is red to send a sell in next candle any help please
Guys, Need help with syntax. I need to find Second Candle of the day's Open Price . The code below works for first half an hour of the day, then it does not produce the result i want because of "0"(Current Candle). Kindly guide me with the right syntax. if ( iOpen ( Symbol (), PERIOD_D1 , 0 ) ==
Dear Forum, noob question for you! I am looking to use the iLowest & iHighest functions, to find the prices of past candles. I don't understand the output however - is it in pips or is it a price? For example I used iLowest to find the lowest value of a candle 5 ticks prior. I used the following
Hello, I am newbie here, so sorry if something wrong with this post. I am working on loading csv structure to array and I am getting this error Structures or classes containing objects are not allowed. I found https://www.mql5.com/en/forum/255091 but not helped me with this error. CSV file consists
hi guys i try to se over the candel a little arrow i create this script it create a rrow but not over the candel and when i zoom it the arrow is so much over anyone have some suggestions ? thankz //+------------------------------------------------------------------+ //|
I guys, I need some help. When I override an HLine object with the mouse, Mql4 draw a label that contain a text of index and level price of Hline. How can I read this text by an Custom Indicator, or an EA or a script? Tank you for every help
I'm brand new to coding. I found a course on Udemy that is really helpful but when I want to do something that the course doesn't cover, I really struggle to understand the MQL4 Docs. For example, it doesn't cover adding objects to the chart. Right now I'd like to add a simple vertical line whenever
Hi, I was told to activate the product in terminal after logging in, but once I did that I do not see where to activate the product. This may have been answered here on the forum, but haven't purchased from market before. How do I actually activate the product? Thanks
I need someone who can build an expert advisor for me
My trading strategy doesn't include trading trading news events, if USD has news at 5, I won't trade it from 4-6, can anybody help me figure out how do i make my EA do this. Thank you
Hi, I will like to know about any coder that can correct 7 EAs to pass market validation. I seriously cannot code it. I have tried almost everything, but of course, no what is totally correct : ) The coder can have a copy of the EAs In Exchange. It is certainly a simple task for someone used to
Hi everyone, I searched in forum but cannot find how to open an URL in MT4 and download a file from an URL. What I simply need is 2 scripts: - One script that open an URL (string type) that given in input of the script. - One script that download a file from an URL, such as: http://www.domain...
Suppose you want to do some action where if on the previous candle of some period indicator a == some value and indicator b<c then open a long position. Because Ontick() runs many times during the current period, when that if statement is true, it will trigger on each tick. So, it would open a long
Hi guys. I have this function template called to_type that I use to convert a string to other data types: template < typename T> T to_type( string str_val) { T val; if ( ( typename (T) == " int ") || ( typename (val) == " long ") ) val = StringToInteger (str_val); if ( typename
I Try to calculate average price of open orders . I am unebel to calculate it. I don't know reason. I am very thankful if eny one can helpme for ( int i= 0 ; i< OrdersTotal (); i++) { if ( OrderSelect (i,SELECT_BY_POS,MODE_TRADES)== false ) break ; if (OrderSymbol()==
hello.. please how to get the previous object on chart this code not getting the previous object for ( int iObj= ObjectsTotal ()- 1 ; iObj >= 0 ; iObj--){ string on = ObjectName (iObj); if ( StringFind (on, "Arrowbuy" ) == 0 ) confirmbuy== true ; }
I would like help in coding the time when my EA on MT4 is turned on and off. GMT 8:00am - 12:00pm GMT 3:00pm - 7:00pm GMT 12:00am - 5:00am These are the hours i trade. What code would i have to use to have my bot run at these times using my MT4 server time. Thank you
I am looking for the Close of the Heinken Ashi. Thought I have everything right, but gives me the wrong value double HAClose; color HColor1 = Red; color HColor2 = LawnGreen; color HColor3 = Red; color HColor4 = LawnGreen; HAClose = iCustom(0,PERIOD_M1,"Heiken Ashi"
Dear Meta Trader Community, Greeting for the Day !! Hope all are doing good here... This is my 1st Post on this forum and i am looking for a little help to code an EA based on attached indicatore . Simple Rule that need to incorporte into EA is Buy : - When Green Arrow Appears Sell :- When Red Arrow
I am trying to write SMA to file but it doesn't write to file . Can someone please tell me what I am doing wrong here..Thanks a lot in advance double ma_0= iMA ( Symbol (), PERIOD_D1 , 7 , 0 , MODE_EMA , PRICE_CLOSE , 0 ); string var1=TimeToStr( TimeCurrent (), TIME_DATE | TIME_SECONDS );
Hi, experienced coders out there , please i need some help in adding alert sound when the 1 2 3 is printed on my chart , thank you for your kindness!! Here is the code .. #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2...
What is the best time frame to download tick story data into? Thanks
i need help with this custom indicator, it works well for pairs with value greater than 1 but flops for pairs with values less than 1
I use RSI divergence as my scalping strategy, the information candlesticks provide is important but i also like the simplicity that a line chart provides in help finding patterns, so I've attached a Simple Moving Average of 1 (SMA1) to the chart which acts as a line graph on top of my candlestick
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408