MQL4 and MetaTrader 4 - page 1471

can some help me with this trialling stop it does not trail void start() { //---- check for history and trading if(Bars<100 || IsTradeAllowed()==false) return; //---- calculate open orders by current symbol Print(TrailingStop); int cnt, ticket, total; for(cnt=0;cnt<total;cnt++) { OrderSelect(cnt
Hi Traders, I have some code ( I didnt write it) that attempts to determine a trades level in respect to the stages I use to perform a partial close. It attempts to count Order History Records, as a way to determine at which level the open trade is currently. It's quite messy and not fool proof....
The following function will close ALL Open positions-- void closeAllPositions() { while(OrdersTotal()>0) { OrderSelect(0,SELECT_BY_POS); if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),999,CLR_NONE);...
[Deleted]
I have heard this indicator to be very effective,but cant get it,pls if any one has a link to it,or any other good indicators dat work well on spotting quick and good trend entries and exits on d daily,i will be grateful!!Cheers.
[Deleted]
Coming from thread https://forum.mql4.com/21235 a Discussion on double arithmetic conditional relationships and HW/SW dependencies... I have run into a problem with the MathCeil() function to determine the correct percent of lots to return to caller for a percent 100. For some reason ( double...
As a safetymeasure I call this early in the Start function: //---------------- SaveAccount ------------------------bool  SaveAccount() {   if( AccountBalance() < BalanceCutOff ) {   Alert("In order to protect the account ", WindowExpertName()," has stopped trading.", " Balance: ",AccountBalance(),...
Hello guys! I have a problem trying to use this library. I put them in metatrader\experts\library I correctly define the path for the .def file ... but my EA print on the register this error: -65495 What can be the problem? And, most, how to solve it? Is it possible that the .def file can be...
[Deleted]
I'm currently using the below function to determine lot sizes. I'd like to make it so that users can use a risk %. How can this be done? double CalculateLots(double Lots) { double Margin; Margin = AccountFreeMargin( ) ; double Hasil; double MLots ; Hasil = Margin/1000; MLots = MathFloor(Hasil);...
  Vesion 5  (1)
I would like to see what you are adding to version 5 of MetaTrader. Is there any documentation that does this? Bill
Hello coders, I have tried to add a signal line to the Osma indicator. It does not work. Please correct the code. Thank you for your help!
Is it possible to create an HTML table in the MessageBox or some other way? I want to have a shortcut where I can add a table with specific stuff I use to look at every now and then.
[Deleted]
Hello, I need help regarding esting EA in MT4. I have several EA that I would like to test with different parameters at the same time. But the problem is, that I get all the trades in same trade terminal from all EA, so I can not evaluate results of each EA setup seperately. Is there any way to...
Hello, i am searching for a good MT4-Coder. It's for some changes in aExpert Advisor. Please PM to me. Best regards, halobungie
[Deleted]
I'd like to write an EA that tracks an indicators values over all timeframes but I need to get the current values that are set on this indicator. For instance: double l_icustom_84 = iCustom(NULL, TIMEFRAME, "SMAAngle", SMAMODE, ANGLET, PREVSHIFT, 0, 0, 0). I need to get the values on SMAMODE,...
[Deleted]
Hello guys, When I test an expert advisor with strategy tester, I see the metatrader run but when it is finish it doesn't show me the results....why?? Thank you. Alessandro
[Deleted]
  EA Start() Loop  (3)
Is there any reason why a loop (like the one below) wouldn't be an effective method? My EA actively monitors a couple of indicators and then monitors active orders for trailing stop's and take profit's as well as reads/writes to multiple files. start() // Special function start()...
When using OrderModify, should you check if the value has changed before sending the stop loss adjustment? Otherwise, won't you get a lot of server traffic being sent every single tick? Is there a way to check it on pip changes instead? I have 5 decimals on my system so would rather a change every 4...
[Deleted]
The following code does not work. What is wrong? void DrawBox(datetime time1, double price1, datetime time2, double price2) { string name = "Rectangle"; ObjectCreate(name, OBJ_RECTANGLE, 0, 0, 0, 0, 0); ObjectSet(name, OBJPROP_TIME1, time1); ObjectSet(name, OBJPROP_TIME2, time2);...
since IBFX is now with 5 decimal places, for some reason when i declare double, the values have 4 decimal places. example Ask price: 1.31475 double askk=Ask; Comment(askk); //the comment only contains 4 decimal places, 1.3147 Is there a way to add more decimal places to a double datatype?
AccountProfit() returns total profit value of the current account. Is there a way to get profit value for only those orders created with a specific magic number ?? Thank you.
  indicator to EA  (11   1 2)
i have this indicator, and i want to add it as a function to the EA. With the EA, my CPU is always at 100%, accessing this indicator from multi time frames, and multi pairs. I was thinking of including the indicator into the EA, so that the CPU usage is lower. Below is the function i have written in...
[Deleted]
Just wondering?
i want this this turned in to an EA thanks i want it to open buy orders when the averages cross to go up and close buys when they cross to go down i want it to open sale orders when the averages cross to go down and close sales when they cross to go up also to do both these at the same time i also...
I'm trying to run a script on my demo account to open an order. The script runs but on sending the order the Journal just says script unloaded. None of my error logging prints out and the order doesn't appear. ANy ideas?
[Deleted]
I'll break down my system to make sure we are both thinking in the same way. Here it is when I do it manually: 1. At X TIME when the market starts a new trading day. I look at thePREVIOUS days HIGH and LOW. (from now at 10pm to 10pm GMT the day before) 2. I place a Buy Stop at the High about 5-10...
It seems live update has a problem with Vista. Vista asked me for administrative permission when live update started. I allowed. But the download never started. It seems it's Vista only and XP is OK. Does anyone have solution? I'm now stuck with build 220. Please help. Thanks.
[Deleted]
  free vps  (1)
Hello everyone, does anyone know where i can get a free virtual server to run my ea? someone told me it's available, but does not know where. if you know where i can get one,kindly reply. Thanks.
[Deleted]
I've run into a problem trying to change the name of function Criterion in my EA which is patterned from the usualexpert.mq4. I wanted a unique trading criteria/strategy name to differentiate it from others in the metatrader include folder. The function has been renamed in the list of include files,...
[Deleted]
Can somebody please tell me how to back test with the Strategy tester correctly? Every time it runs the test, it has zero results, zero trades. I downloaded the history files and set the expert key correctly (I believe). It doesn't give any recognizable errors in the journal. It runs the test, or so...
[Deleted]
Is there a way to keep drawing an object on a chart, with the same name, continuously? Is there a way to make the name a variable?