Forum

Code stopped reading news on forexprostools.com

I used to be able to read news on forexprostools.com, but now getting error 5004, "cant load file"..... has something changed there? Here is my code: string ReadCBOE() { string cookie= NULL ,headers; char post[],result[]; string TXT= "" ; int res; string investingUrl= "

Close all trades code

I have this code which should close all trades when a certain condition is met. Normally 3 open trades of the same symbol are open when the condition is met. However, the code closes one trade and leaves 2 others instead of closing all the three trades how do I amend the code to close all the three

Changing chart period on tick with ChartSetSymbolPeriod

Is it possible to change chart period with an expert advisor on tick?I'm using this code but having issues. Can one help? void 0 ntick() if (adx0> 5 ) { move_to_a_different_TF(); } .. my function void move_to_a_different_TF() { //; ChartSetSymbolPeriod ( 0 , NULL , PERIOD_H1 ); }

Array out of range Heiken ashi indicator

I am getting this error on the H ashi indicator: array out of range in 'heiken_ashi.mq5' on this line: double haOpen=(ExtOBuffer[i-1]+ExtCBuffer[i-1])/2; The whole code is shown below: How could this error be solved? //+------------------------------------------------------------------+ //|

Select order by magic number

I have two pending orders open, with magic number 222 and 444. I want the ea to delete the order with the largest magic number i.e 444. How do I amend this code to perform this function? Thanks. //+------------------------------------------------------------------+ //| Delete all pending orders

Rounding up price values mql5

How do toy round up or down price value to whole numbers in Mql5? for example: EUR/USD = price now: 1.1796; Round up: = 1.1800 round down:=1.1700 USD/JPY: Price now= 109.45 Round up: = 110:00 round down:=109:00 Thanks

Mql5 ICustom indicator intergration

Hi, I have an EA than has I custom calls on indicators. I need to sell it to someone but I don't want them to download the indicator. how do I entergrate the indicator into an EA? The I custum all is as follows int OnInit () { HAOPEN = iCustom ( NULL , PERIOD_H1 , "heiken_ashi" , 2 , 3 ); // open

Latest Position type

The code below correctly identifies the position type when there is only one trade opened, however if there are more than one position opened, the code does not return the latest position type. How does i modify it to identify the position type of the LATEST opened trade if there are more than one

How do I sort out this array out of range error?

double closeh4x[]; ArraySetAsSeries (closeh4x, true ); CopyClose ( _Symbol , PERIOD_H4 , 0 , 30 ,closeh4x); double close26h4x=closeh4x[ 26 ]; //================ The error relates to the close price of the last 26th candle and states ' Array out of range' How do i fix this

Single curtrency to Multicurrency EA Conversion

How do I turn a single chart EA to a multiple chart EA? e.g, the EA is normally attached to 3 charts EURUSD, GBPUSD and USDCHF on mt5 terminal. The problem comes when you're looking at testing on the three symbols simultaneously on the visual tester . Problem is on each recall of the indicators on