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'm trying to hobble together an EA from a template program and am running into a few problems with the code and was hoping that someone could help (it's probably riduculously easy but I'm still lost).
The theory is simple:
- enter and go short if the RSI crosses up over 50
- enter and go long if the RSI crosses down 50
The exists are strictly based on TP and SL.
With this strategy, multiple open orders can accumulate. The problem is that the EA seems to only open a new order if the previous one has closed.
Can anyone please help and show me how the code needs to be modified to allow multiple open positions at the same time each time a new entry signal is given and exit only if a TP or SL has been reached.
__________________
"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
I tried your recommendation but it didn't seem to fix it.
I've attached a 2 day sample backtest result as well as a screen shot to show what happened versus what should have happened. During the time frame it only executed 3 trades when it should have executed something like 30.
Do you or anyone else out there have any more ideas?
did you change the settings on both of the ordersend functions? (i found two).
on my tester it got much more than three orders.
hope this helps.
__________________
"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
notepad file has a number on the right, of the take profits and stop losses.
__________________
"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
Yes I changed both order fuctions - one for the OP_Buy and the OP_Sell.
I took a quick snapshot of only two days on a 5min chart to show that with many crosses the only ones that are executed are those where previous open orders have closed.
I attached the "fixed" EA version based on your recommendations.
I took a look at your results and noticed that while you have a lot more orders it’s because of you the test dates. Also, the results still show that only one order is in play at one time.
Guys - I know there's quite a few senior and experienced programmers out there - please help - again, I believe this is probably a simple problem that would take 5 min for the "mistake" to be found by someone with the skillset which alot of you have.
I'll put the code here to make it easier for someone to review...
Thanks again to Eaglehawk for stepping up and trying to help.
Guys - I know there's quite a few senior and experienced programmers out there - please help - again, I believe this is probably a simple problem that would take 5 min for the "mistake" to be found by someone with the skillset which alot of you have.
I'll put the code here to make it easier for someone to review...
Thanks again to Eaglehawk for stepping up and trying to help.
perhaps turning your slippage to "0" or "1" might help a little?
__________________
"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