void CloseAllOrders( int slippage, int magicNumber) { int x; double trades[][ 4 ]; int total= OrdersTotal (); if (total> 0 ) { ArrayResize (trades,total); int count= 0 ; for (x=total- 1 ;x>= 0 ;x--) { if ( OrderSelect (x,SELECT_BY_POS,MODE_TRADES)) if (magicNumber ==
.. this does not work as the ArraySize is zero: //within OnInit() of an indicator: int i=0; SetIndexBuffer(i,Buff_A); SetIndexStyle( i,DRAW_LINE,STYLE_SOLID,1); SetIndexLabel( i,"EmaFast"); i++; SetIndexBuffer(i,Buff_Ta1); SetIndexStyle( i...
How come no record for an event as important as REASON_PROFILE in this table, or is there a way to configure it manually or maybe it exists and I do not know? I have made good use of some of the ones listed. However I still need a Constant for REASON_PROFILE for profile change. Any one with a good...
How to remove/hide the "currency pair name" in the top-left main chart. I want to only display my indicator in main chart. How can I do that in MQL4? Please don't suggest to change the color of foreground because I want to use other indicator in Sub-window.
I have a problem with if condition and && operator. This simple code alway give "true" as result, when must give "false". Any idea about the problem? I'm getting crazy.... Thanks in advace double a=3; double b=5; bool c=true; bool d=false; if ((a<b)&&(c=true)&&(d=true))...
Hello friend, I am not able to modify this EA I would add the risk percentage based on (balance) you can help me? post the code ea : #include <stdlib.mqh> #include <stderror.mqh> #define NL "\n" // Regular variables bool LotIncrease = true; bool...
Hi Community, I would like to backtest a few eas automaticaly and export the results to a CSV everytime including a few furter fields like EA name, timeframe and so on. Further I would like to add a screenshot of the backtest result. Is this somehow possible? Thanks! -J.
hi guys ..i have some troubles with this block of codes .. int init() {////////////////////////////////////////////////////////////////////////////if(MarketInfo(Symbol(), MODE_DIGITS)==3||MarketInfo(Symbol(), MODE_DIGITS)==5)mypoint=10;else mypoint=1; pte=Point*mypoint; return...
I've been toying with a bunch of EAs I've written, and the optimization takes forever. Is there any option to make the optimizer work on a multi-thread setup, or a third party option? Thanks!
New article Portfolio trading in MetaTrader 4 has been published: The article reveals the portfolio trading principles and their application to Forex market. A few simple mathematical portfolio arrangement models are considered. The article contains examples of practical implementation of the...
Hey Guys, I have currently two problems. 1. How can I display a name of a horizontal line on the chart? - I tried to create a label and set it with TimePrice to XY to the right position. But there is the problem that it will always be on the same XY... So if I press + or -, the label is somewhere.....
Hello, I'm newbie, but I'm trying to develop an EA. I would like to open long or short positions on the basis of my signal at determinate price. in particular: OrderSend with OP_BUY or OP_SELL at price of open current bar. OrderClose at price of close current bar. Thank's a lot...
Is there any function to show Positive & Negative Sign for numbers? For example if the result is 5.0 it should display the +5.0 and for negative number -5.0. I tried to use "+ sign" to concatenate but if I use #property strict it gives me warning: implicit conversion from 'number' to 'string'...
The new version of MetaTrader 4 Android features a free built-in chat enabling traders to chat with other MQL5.community members. Specify the desired user's login in a message recipient's section to send a message directly to this user's mobile device. The built-in chat allows you...
I created my indicator then run it but how can I change the input setting? I use extern for MA_Method and Period. Where to find the setting for extern? I want to change it when my indicator is running. If I use the built-in indicator the input setting is easy to change: You have to click the...
Hi all! I was opening new charts and got to a point where it does not open a new chart. How do i increase this limit? thank you! I actually reached this limit because for every pair/instrument, i open 2 of the same chart as i want to have 20 & 50 MA and another with 20 & 50 EMA, instead of...
Hello there my EA seems to put double the trades when I put it on a DEMO account. (they are entry orders) Does anyone has an idea what could it be? Thank you Luis
Hello , I have a doubt about the back test . I am checking my indicator that points out the candles , making a back test would merely truthfully or I could find a chart with candles position that does not match up with reality ? Another doubt , if you increase the speed of the back test execution
Hello, While I try to compile the mq4 file, I receive various errors. I attach the corresponding txt file 'research 5 - chart 2 red lines ETI.txt'. I looked up on compiling errors, but could not see an answer. I have following errors and warnings: * 'ObjectCreate' - variable expected (11, 6)...
How to reset the default value of Global Variable Array inside the function? I use global array to used it in many function but I want to reset it first before using it because I used the global array in different function. bool x[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};void aaa(){ x[] =...
Can you please help with this. This indicator has no errors on metaeditor yet when I try adding it to metatrader it doesnt connect.//+------------------------------------------------------------------+//| MA_In_Color.mq4...
I'm trying to code an indicator that displays a histogram of each hour in the past based of a candlestick's high and close. For example it calculates whether each specific hour in the day has been bearish or bullish based of the past data. For example.. Each bar in the histogram represents each...