Forum

MT4 adding commission to (risk) lot size calculaton.

I am using below code to calculate lot size before opening order, but now I changed to ECN accout that has commission. Is it possible add commission to lot size calculation before order is open on a symbol? double lots = AccountBalance()*(RiskPercent/ 100.0 )/(StopLoss*pipValue);

WindowScreenShot from MT4 Active Workplace?

Hello, I want to get a Screen Shot that is called by EA when order is closed and make screen shot from MT4 Active workplace. Manually it is possible to make this by selecting 'File -> Save As Picture... -> Active Workplace -> OK', but is it also possible with EA? Unfortunately I have only found

Keep EA alive in terminal..

I started testing EA on Live Demo account . I noticed that EA cycles throe code every time new tick is coming in. I need to keep EA..so to say alive and execute ordersend etc. when some EA condition is true. Closest that I have found so far is one script that is generating artificial tick (..as I

Second opinion needed, How to locate order with lowest price?

Stuck with code where I need to locate order that has smallest OrderOpenPrice(). Code selects latest open order (position)..why not order where OrderOpenPrice is closest to not dependent what time order was added or position? double bScanOpn; double bScanPenOpn; double TopPrice= 0 , MinPrice=

Scan price range and add orders if missing.

Having trouble coding logic for checking Price Range and if any order(s) is missing on any price between range new order is sent. Here I tried to make code to check range between buy order open price and buy order stoploss price and send buylimit orders to missing prices in that range. int

Total profit for orders with same magic number?

Guidance needed as I cannot figure out code for looking at total profit value for specific orders in order pool. Looks like my piece of code is too far off..can someone push me to right direction //--orders profit/loss with magic int Total= OrdersTotal (); double bProfit=OrderProfit();

Buy orders in history

Need some support with code. I want to find number of all buy orders in history for start with. Have been looking for number of samples but they do not make sense for me as I am still in learning curve. Below is my sample for finding latest orders with magic number. Want to add here code for finding

Alerts and Warnings when running MT4 tester

I can not get Alert or PlaySound working when running my EA code in tester. Print command does work in Journal, but with lag and I prefer popup alert to troubleshoot my code. Any suggestion what should I try? if (a1> 1 ) //fix: when there are more

Find latest order in account history

Have problem where I want EA to find data from latest closed order in account history that has special comment. I do not know mql language so good and have problem to figure out logic how to solve this problem //-- Information from history orders int hst, hstAll=OrdersHistoryTotal()

Looking for EA coder

Hello, I am looking for EA coder to hire. Small description from EA: EA takes trades based on EMA and MACD signal. EA needs to be able to look into account history and based on outcome use one of three money management for lot size. EA needs to manage several open orders when market direction has