Ask+TakeProfit*Point = Actual take profit
1.4002 + (50pips * 0.0001) = 1.4052
And therefore the EA will put down 1.4052 as our take profit. Here is the problem. What if we revalue the parameter of Take Profit as ZERO? Further elaboration as below:
Ask+TakeProfit*Point = Actual take profit
1.4002 + (ZERO * 0.0001) = 1.4002
Now, I doubted what is the purpose for you to trade something stupid like opening and close trade at breakeven? I even doubted whether your broker is going to allow you to do so. Most broker has the minimum 5pips limit between their order open price and their take profit/stop loss... hmmm... here is what I did. Change it from "double" to "int", add new variable as SL and TP to accommodate the actual value of the price we want to take profit and stop loss.
Screenshot above is showing how I declare my new variable. I've added "//" to remark the old codes.
2nd screenshot. I've removed the TakeProfit checking routine. We will check the take profit value later.
Here is the screenshot I added the new set of codes to allow 0 stop loss and 0 take profit to the system. The logic as below:
StopLoss=50
if StopLoss>0
Ask-StopLoss*Point = SL
1.4002 - (50pips * 0.0001) = 1.3952
Otherwise
SL = 0
Now we have a real 0 Stop Loss.
Here is the set of code I added to sell position.

5 comments:
Hi David, I attempted to contact you via a Private Message on the TSD forum however my message was blocked for some reason. I wanted to know if you did any forward testing of the Solo 1.5 EA and if so what were your results with it please?
I like your blog here and will be watching and learning with great interest.
Thanks Jim
Thank you for your comment Jim. However, I have not come across Solo EA. Is it commercial EA? Or is it freely available? For your information I have not demo for other's for a long time now, since I have not enough time for my own development.
Hi David, here is the link with what I thought was your signature and comments on the Solo 1.5 EA:
http://www.forex-tsd.com/expert-advisors-metatrader-4/6130-solo-insisting-way-6.html
My apologies if it's not you.
Jim
Ah! That Solo. Yes that is me. As a member of the forum, I saw junior having difficulties with their new EA, I offered help. I have not work on it for a long time and do not have any information with me regarding that EA.
Hello again and thanks for your reply David,
Is your Forex Knight available to test or is it a mythical beast yet to be developed?
Would also like to know more about your other systems that you are showing stats for on this blog?
Thanks, Jim
Post a Comment