Disliked{quote} I can help you with your doubts while you create the EA yourself. If you expect me to do everything for you, then I am sorry.Ignored
MT4 build 1220 EA running OK, build 1260 not OK 1 reply
Why your broker is your friend and your enemy 4 replies
MT4 Compiler Build prior to Build 6xxx 7 replies
Making your Indicators work with MT4 Build 600+; Simple! 1 reply
Build 201 has new function names that can mess up your EA 0 replies
Disliked{quote} please can you help with fixing errors in this EA and making it fast to refresh {image}Ignored
Disliked{quote} The error may be due to all the variable that you are using such as PriceOpen_BuyLimit, PriceOpen_SellStop, PriceOpen_SellLimit, etc have some error with their declaration. For Example: One of the error says that in line no:23 the declaration of the variable is having error. Even if in the snapshot i could not see line no 23, from my experience i think you are trying to declare variables wit same name twice. It mean you need to check that if "double PriceOpen_BuyLimit" is declared once, you should not add the keyword "double" again while...Ignored
Disliked{quote} The error may be due to all the variable that you are using such as PriceOpen_BuyLimit, PriceOpen_SellStop, PriceOpen_SellLimit, etc have some error with their declaration. For Example: One of the error says that in line no:23 the declaration of the variable is having error. Even if in the snapshot i could not see line no 23, from my experience i think you are trying to declare variables wit same name twice. It mean you need to check that if "double PriceOpen_BuyLimit" is declared once, you should not add the keyword "double" again while...Ignored
DislikedPlease do you have any idea why more than 4 pending orders will not work in the ea or platform? I ask because i multiply the pending orders in the ea, and it compile without error, but is not working? Only the previous 4 that is workingIgnored
Disliked{quote} For your first problem where the EA is not refreshing on every tick, you need to check that under which function you are writing the whole code. I use to face the same problem before. use this: void OnTick() { } Write your essential code inside "void OnTick" method (you can see its details in help section) and on every tick this method will be recalled again and again thus giving you a refresh data. For extra precaution use also RefreshRates(); inside it so that the rates will be refreshed before making any calculations. For your second...Ignored
Disliked{quote} Thanks so much for your time your effort and reply, please for the RefreshRates(); must i write numbers between the brackets?, can i remove sleep (100);and sleep(1000):of the code, am thinking its making the code to sleep for second problem i have $27,437.80 on the account am using to test the EA and i use 0.01 for each order, thats why am surprised why its not opening, exactly the same code i multiplied change variable name as you advised, it compiled without errorIgnored
Disliked{quote} For RefreshRates(), you do not need to put any value inside. Delete the sleep() function as it is slowing you down and it may be the reason why the prices are not getting update at every tick. For the problem with pending order, the balance should not pose any problem, the only reason which is causing problem is the "if()" conditions you are providing before executing the pending order function. as the if conditions are correct in syntax, you are not seeing any error, but the conditions itself causing it to fail. recreate your conditions...Ignored
Disliked{quote} i have tried all i can for this to work but no way out, i comment out the sleep part and the EA no longer work normal, i dont have experience to re-write the EA, i have searched even no paid version doing what i want to use it for, i am down financially just wanted to start somewhere, even if is only two active pending orders am able to see i can manage but nowhere all the ones online are not with specified price entry and they are all faulty, a lot of them will not compile i hope to find helpIgnored
Disliked@D.S please Sir i must try to re-write this code, but please you will help me ny guiding me how to do it, because i dont understand the meaning and functions of some codes inside the idea behind this EA it is that in case of volatility price must pick any of the stops for movement, so ea remain stagnant and price picks it at certain levels so i will start with extern variables for price input, do i have to put the declaration of working with 4 and 5 digit brokers in Void On Tick?Ignored
DislikedDisclaimer: Please note that this thread has nothing to do with any particular EA nor it will provide any valuable trading knowledge. I could not find any thread where people are taught to build their own EA, so I started this thread. Who m I ? Just a simple trader who thinks designing our own system will give us more free time. Technically I am a designer too, and have designed multiple EA for large number of peoples including myself. What this thread will offer: We will discuss all possibilities available for a trader to design their personal...Ignored
void OnTick() { int NrOfDigits = MarketInfo(Symbol(),MODE_DIGITS); // Nr. of decimals used by Symbol int PipAdjust; // Pips multiplier for value adjustment if(NrOfDigits == 5 || NrOfDigits == 3) // If decimals = 5 or 3 PipAdjust = 10; // Multiply pips by 10 else if(NrOfDigits == 4 || NrOfDigits == 2) // If digits = 4 or 3 (normal) PipAdjust = 1; //---- double nTickValue=MarketInfo(Symbol(),MODE_TICKVALUE); //value of a tick if(Digits==3 || Digits==5){ //If the digits are 3 or 5 we normalize multiplying by 10 nTickValue=nTickValue*10; } int slippage = Slippage * PipAdjust; double buy_price; double sell_price; double mid_price = (Ask + Bid) / 2; if(mid_price < 1.38 && mid_price > 1.36)buy_price = 1.38; sell_price = 1.36; if(mid_price < 1.36 && mid_price > 1.34) buy_price = 1.36; sell_price = 1.34; if(mid_price < 1.34 && mid_price > 1.32) buy_price = 1.34; sell_price = 1.32; if(mid_price < 1.32 && mid_price > 1.30) buy_price = 1.32; sell_price = 1.30; if(mid_price < 1.30 && mid_price > 1.28) buy_price = 1.30; sell_price = 1.28; if(mid_price < 1.28 && mid_price > 1.26) buy_price = 1.28; sell_price = 1.26; if(mid_price < 1.26 && mid_price > 1.24) buy_price = 1.26; sell_price = 1.24; if(mid_price < 1.24 && mid_price > 1.22) buy_price = 1.24; sell_price = 1.22; if(mid_price < 1.22 && mid_price > 1.20) buy_price = 1.22; sell_price = 1.20; if(mid_price < 1.20 && mid_price > 1.18) buy_price = 1.20; sell_price = 1.18; if(mid_price < 1.18 && mid_price > 1.16) buy_price = 1.18; sell_price = 1.16;
DislikedHi D.s I am trying to develop an EA to test a strategy using MT4 strategy tester, basically involving trading round numbers. I have been able to put together a working EA (through trial and error and copy and pasting snippets of codes here and there from other EAs. I am not a proficient mql coder by any means) that can trade at round numbers at every 100 pips. However, I want to make it to trade at every 200 pips and I have been finding it difficult to come up with a workable EA. Anyways, I decided to try a very crude method (basically hard-coding...Ignored
if(mid_price < 1.36 && mid_price > 1.34) { buy_price = 1.36; sell_price = 1.34; }
Disliked{quote} Hi... I think the error is in your if() writing style when the condition satisfy it will only execute thee next line, so put all the lines you want to execute after the condition satisfy, inside braces { }. Semicolon means change in line. It does not matter if you write it in a single line. For example: if(mid_price < 1.36 && mid_price > 1.34) { buy_price = 1.36; sell_price = 1.34; } Repeat this with all the if conditions. This will fix the issueIgnored