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 am getting an invalid stop every time my EA goes to trade. It is driving me nuts. I have posted the OrderSend code for you to look over.
int ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,6,Bid+1 5*point,Bid-takeProfit*Point,"comment",283,0,CLR_NONE);
int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-15*point,Ask+takeProfit*Point,"comment",283,0,CLR_ NONE);
A side point. I have int ticket for both functions as I have the buy and sell in seperate modules. Didn't want anyone to think I was declaring it twice.
Upon further review. I made those changes already. Sorry about that. I actually had it in my code like that and still got the problem.
int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-15*Point,Ask+takeProfit*Point,"comment",magic,0,CL R_NONE);
The problem still persists? I don't see any problem.
Try to define the stoploss variable:
extern int stoploss=15
and modify the ticket to:
int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-stoploss*Point,Ask+takeProfit*Point,0,magic,0,CLR_ NONE);
may be this will work. However I can't see any problem.