| New signals service! | |
|
|||||||
| 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 | Thread Tools | Display Modes |
|
||||
|
you will notice near the top, one of the phrases is if(OrdersTotal() < 1), and the function thereafter. that is how you regulate only one trade at a time.
PHP Code:
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk ![]() ![]() REMEMBER, "Genius is nothing but a greater aptitude for patience." –Benjamin Franklin ![]() ![]() ____________________________________ Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!! http://sufx.core.t3-ism.net/ExpertAdvisorBuilder |
|
||||
|
Quote:
|
|
|||
|
Hi,
By using if(OrdersTotal() < 1), only 1 trade will opened at a time. As soon as 1 trade is closed another will be opened if the conditions meet. if we use if(OrdersTotal() < 2), then 2 trades will be opened at a time. we need a code to open 1 long trade and hit tp, and wait for next trend to start to open a short trade. |
|
||||
|
there are several ways you could approach this problem. to determine the trend is a simple method that could be accieved by almost anything.
a moving average is one that i find the most crucial and effective. there are ways to determine the slope which i don't have the time to come up with right now, but maybe in a week. one other way is subtacting the highs and lows or opens and closes to determine trends.
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk ![]() ![]() REMEMBER, "Genius is nothing but a greater aptitude for patience." –Benjamin Franklin ![]() ![]() ____________________________________ Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!! http://sufx.core.t3-ism.net/ExpertAdvisorBuilder |
|
|||
|
Thank you for your reply Eaglehawk,
I am looking for a code that would do this: Send one order per trend, if order hits takeprofit or stoploss, the order is closed.If the trend continues, it should wait for the trend to change to send another order. Thank you for your time and help. |
|
||||
|
Is it all right if you send over the ea you want the code attatched to. firstly, some ea's are setup differently than others. secondly, it helps to have the benifit of something to add on to and show than tell what to put in the code.
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk ![]() ![]() REMEMBER, "Genius is nothing but a greater aptitude for patience." –Benjamin Franklin ![]() ![]() ____________________________________ Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!! http://sufx.core.t3-ism.net/ExpertAdvisorBuilder |
|
|||
|
Hi,
For eg if you look at the expert i attached.... you'll notice that this ea has potential but will open trades even while the trend is fading and all those trades would result in a loss. so if we can restrict this ea to send one buy order after the price moves above the pivot and close it in profit or loss and wait until price moves below the pivot to send a sell order. Thanks |
|
||||
|
Quote:
Thanks |
|
||||
|
Quote:
Thanks in advance Last edited by babarmughal; 11-10-2006 at 09:15 AM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To trade or not to trade Indicators? | yaniv_av | Indicators - Metatrader 4 | 1 | 03-27-2007 01:01 PM |
| How to modify this order | deeforex | Questions | 0 | 06-07-2006 06:03 PM |
| One Order per Bar....... | babarmughal | Expert Advisors - Metatrader 4 | 2 | 05-09-2006 09:09 AM |