Forum

how calcolate size of 2% equity

Hello to all I'm writing an ea for mt4, I wanted to open an order with a size dimensioned to 2% risk relative to capital I wrote the following code, when I go to calculate the size, gives me a size of 14 lots, using a demo account by EUR 5,000 and a stop of 50 pips. Obviously it is wrong, you tell

how i can understand if the color of two heiken ashi candle has changed

In mql4, how i can understand if the last ha candle has change it's color from previous candle? i get info about ha candle, with this code: last ha candle: int shiftLastCandle = 1; double haOpen= iCustom ( NULL , PERIOD_D1 , "HeikenAshi" ,Red,White,Red,White, 2 ,shiftLastCandle); double

how i can get the chart id of all the opened chart

i'm building ad indicator in mql for mt4 in my mql indicator, i need to get the chart id of all the chart that i opened manually on my mt4 how i can get these id

how to open a profile form button click

it's possible to open a profile in mt4 when i click on a button created on my chart? i found how to open a chart with the function ChartOpen(), but i need to open a profile this is my code to open a chart on button click void OnChartEvent ( const int id, const long &lparam

how to open a chart from button click

hi wi would open a eurusd mt4 chart when a click a button, this is my code that show a button, when i click it, it's does not open any chart of eurusd, where is my error? #define WM_COMMAND 0x0111 string eurusdButton = "eurusdButton" ; int OnInit () { ObjectCreate ( 0 ,eurusdButton, OBJ_BUTTON

ho i can call supertrend indicator?

Hi i dont understand how to use supertrend indicator for mt4 i try this code: double superTrendValue = iCustom ( NULL , 0 , "Downloads/SuperTrend" , 14 , false , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 0 , 0 ); Print ( "superTrendValue: " ,superTrendValue); but it does not work anybody can

how to read forex news from forexfactory calendar with WebRequest

hi in my ea, i would like to read the forex news on 16/11/2015 from forexfactory calendar on 16/11/2015, i wrote this code: void getNewsCalendar() { string cookie= NULL ,headers; char post[],result[]; int res; string calendar_url= "http://www.forexfactory.com/calendar.php?day=nov16.2015"

how to find high/low for 2 min timeframe

hi i dont understand how to find the high and the low of the last 2 minute candle i use this code: void OnTimer () { datetime thisTime = TimeLocal (); MqlDateTime tm; TimeToStruct (thisTime,tm); currentHour = tm.hour; currentMinutes = tm.min; int currentSecond = tm.sec; long div