Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
I would like how to go about it that when I open a buy or sell position and at the same time a stopsell or stopbuy how do i assign the same number to the orders so that if the one is Triggered it will automatically close the other order. I know you must be able to do it with the magic number but also something about the time in the Magic Number? The second question. When i place code into my orders section I force the program to only open one order on that bar but when I do this the Ea don`t Trigger orders when the conditions are met to open orders When I remove the code It does open orders where it meet the conditions. Any thoughts as to why this is so? Here is the code.
Let's say Period() =5. How can I read the ticks current trade minute and seconds within that Period?? Example: Minute =3, Seconds=42.
What I want to do is check a condition within my ea every 4 minutes 50 seconds into the 5 minute period - Can you help!
Dave
In a 5min timeframe, i think that only you can check some situation at a determined time is when a new tick arise. You will can to view if the time elapsed from the opened bar is the time that you want.
At each new tick the start function of mql code will run, then you will need to monitor if the time elapsed from the last bar opened is the time that you want with Date & Time Functions of MQL.
If no new tick arise between your time (4min50sec) and a new bar opened period (5min) i don't know how to check because i never need to do that.
I am new to MQL4 and am trying to get the previous CCI value. I have tried using the iCCI function with a Shift value of 1, but it does not give me the previous value. How would I do that without saving the current value to a variable? I am trying to determine the direction the CCI is going.
The code is tick based, so if there is no tick at that time, then the code will miss the time check. I don't think you can get it to the exact second without some kind of loop that is contantly running.
__________________
Life is a Gamble. You win some. You lose some. And life goes on.
Your problem is in your lot size (volume) in your order send statment. which returns a -1 because of the error. the ticket veriable doesnot contain a ticket number it contains the errror flag of -1 which triggered the other errors with the ordermodify function. You must correct the lot size variable mylotsi, to contain an acceptable value. second you should check the return value in the ticket variable to see that it dosenot contain an error flag before calling the ordermodify routine.