Forum

Determine start of Asian Session (Tokyo) independent from brokers server time

Hello, I do need to determine the start of the Asian Session (Tokyo) within my EA without using the brokers server time or any kind of online-check by connecting to a server. Most of the time the Asian Session (Tokyo) is at 00:00 at the brokers server time (for example: Global Prime, IC Markets

OrderDelete() returning "invalid parameters", MT4 bug?

Hi, In rare cases I am getting a "invalid parameters" error for OrderDelete() which only needs the orderticket to do it´s job. This is for OP_BUYSTOP or OP_SELLSTOP order types. Before each run for OrderDelete(), I am browsing through OrdersTotal(), check them for OrderType() (only processing

Need a Custom Print() function that splits the string

Hello, I need a function for an EA that is similar to Print() but that takes into account the maximum length that can be displayed in the Journal-tab of MT4 without truncating the string. So basically I need a function that simply replaces Print() in the whole EA that then looks at the string I pass

Print(DoubleToStr(15/17, 4)); = 0?

Hi Everyone, I need some help, I don´t understand why this always returns 0?: Print(DoubleToStr(15/17, 4)); Outcome in the log is 0.000 What am I overseeing

Find the 10 (or X) highest values of an array

Hello, I have an array with 4000 values and would like to find the 10 (or X) highest values in that array, not just the highest. I am really not sure how I would go about that. Can anyone help please? Thanks

GAP Detection for EA

Hello, I want to add a gap-detection to my EA (MetaTrader 4) and am not sure how to exactly do it. The EA is very simply and compared prices X minutes ago with the current price and then trades. However, after weekend there are of course gaps in the chart, but my EA thinks it´s a breakout and opens

Need code to make EA stop live trading if a specified relative drawdown has been reached

Hi, I am struggling on how to implement a function into my EA that makes it stop live trading once a certain relative drawdown from the equity high(!) has been reached. So say it has achieved 1000 EUR NetProfit and now a drawdown of 400 Euro happens from that equity high of 1000 EUR, I want to make