|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
||||
|
Quote:
Please refer to my reply here. I can make a demo for you if you want, Please tell me the indicator you want to add to ''disable alert once hit''. |
|
|||
|
Hi - a simple question (I hope...)
How can I code a time base exit command ?
I want to know the duration of an open position expresse by the number of bars that position already open. Actually, I want to close a position automatically after 30 bars (in my expert-advisor) How can I code that in mql4? 10X ! |
|
||||
|
Quote:
I'm so sorry for the delay in replaying you; I've spent all the day fixing my damn car to reach my office and reply your questions .Now you have an EA and want to close the order after 30 bars (or whatever count you want), Right? Well ![]() Place this function on the top of start() function: PHP Code:
bool BarsCountDown(30); The line above returns false if the current bar hasn't exceeded the number 30 from the first call of the function (the 30 bars not yet counted) And returns true if the current bar has exceeded the 30 bars So, when you get true, close the position In your start() function you may use code like this: PHP Code:
|
|
||||
|
Quote:
Did that work for you? |
|
|||
|
Hello,
First of all I am very imprest with this site and also with coder, who is helping us to test and make difference code I am looking to have a code to open and close my position with the following deffination ema = 3 ema = 13 when ema 3 cross from down to ema 13 plus move 5 pips up, the order will open automatically eample ema 3 and ema 13 cross at 1.1705 for euro/usd my order will be open at 1.1710 it is something like bunnygirl system but I dont know how to make expert please help me. same technique for selling but all technique reverse Thanks |
|
||||
|
Quote:
Please try this: PHP Code:
|
|
|||
|
Quote:
|