| 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 |
|
|||
|
invalid stop driving me nuts
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); |
|
||||
|
Quote:
There's no problem in your above line of code Could u send the EA? |
|
||||
|
Quote:
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. ![]() |
|
|||
|
Quote:
Code:
double stopLoss=NormalizeDouble(15*Point, Digits); int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Bid-stopLoss,Ask+takeProfit*Point,0,magic,0,CLR_ NONE); |
|
|||
|
Some things in mq4 are case sensitive.
Ex: colors ...brown isn`t recognized while Brown is. Everywhere in your code (including variables), try changing these: stopLoss to StopLoss takeProfit to TakeProfit point to Point Make sure that all words "lots" are either all spelled lots or Lots --------------------------------------- Quote:
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error 130 - invalid stop. Why? | Lou G | General Discussion | 9 | Yesterday 05:23 PM |
| Please help Invalid stops Error 130 | cardio | Setup Questions | 4 | 06-30-2006 04:31 PM |
| ERROR: Invalid Integer Number As Parameter | secxces | Questions | 4 | 05-25-2006 02:50 PM |
| invalid account | huhenyo | Metatrader 4 | 4 | 04-03-2006 07:37 PM |