| 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 |
|
|||
|
i'm trying to write my own EA, but ran into confusion
extern double TakeProfit=25.0; extern double StopLoss=20.0; extern double Lots=0.1; ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,10,Stop Loss,Bid-TakeProfit*Point,"pip-catcher SHORT",12345,0,Red); ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,10,StopL oss,Ask+TakeProfit*Point,"pip-catcher LONG",12345,0,Green); To me, it looks allright, but when i run it on StrategyTester 1H EUR/USD Open Prices only. When it try's to open position, it shows error - invalid stops means that stoploss and takeprofit are wrong? When i change those something else(bigger,smaller) or writing number out insteed of Stoploss or TakeProfit inside OrderSend, but still the same invalid stops any help, i'm getting angry against MQL4 already ![]() |
|
|||
|
Try this:
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,10,Bid+StopLoss*Point, Bid-TakeProfit*Point,"pip-catcher SHORT",12345,0,Red); ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,10, Ask-StopLoss*Point, Ask+TakeProfit*Point,"pip-catcher LONG",12345,0,Green); Quote:
|
|
|||
|
Actually it still keeps giving invalid stops on every order
but i chanced these to ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+0 .0020,Bid-0.0030,"pip-catcher SHORT",12345,0,Red); ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-0.0020,Ask+0.0030,"pip-catcher LONG",12345,0,Green); and seems that this way works, theoreticaly that should be same |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exit Strategy: Stepping Stops vs. Trailing Stops | stu | Expert Advisors - Metatrader 4 | 45 | 07-31-2008 12:18 AM |
| Tighter Trailing Stops && Stops | Nicholishen | Expert Advisors - Metatrader 4 | 25 | 06-27-2008 01:04 AM |
| EA -- OrderSend issue | SaxMan | Metatrader 4 | 2 | 02-23-2007 03:00 AM |
| OrderSend question | knili | Metatrader 4 | 5 | 10-03-2006 12:16 AM |
| How many parameters can the OrderSend allow? | Aaragorn | Questions | 6 | 07-17-2006 10:31 PM |