|
|||||||
| 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 |
|
|||
|
buy order problems
this bit of code doesnt seem to buy, any ideas why?
Code:
if(Close[2]<ma && Close[1]>ma)
{
OrderSend(Symbol(),OP_BUY,lots,Ask,3,stop,Ask+profit,"",2005,0,Green);
}
|
|
|||
|
that worked, very much appreciated, but why the "ticket", "orderselect" and "Point" x ask+profit?, i'm reading through your tutorials atm, i apologise if i missed this info. thanks again.
Last edited by trevman2005 : 12-22-2005 at 09:50 PM. |
|
||||
|
Quote:
You're welcome! If you noticed the code: 1- I've changed if(Close[2]<ma && Close[1]>ma) To: if(Close[1]<ma && Close[0]>ma) Because the index of the new bar is 0 and the index of the previous one is 1. 2- I used ticket and OrderSelect only to check what the wrong (if any) is. (Please prefer to Appendix 2 - Trading functions) 3- I've changed stop to stop*Point and profit to profit*Point. |
|
|||
|
Quote:
i've also noticed that my stoploss is set to 30 and my take profit is 80, yet my backtest results give me around 17 loss and 45 profit, why does it do this? thanks again. |
|
||||
|
Quote:
(EX: if you trade EURUSD the point value = .0001 and if you trade EURJPY the point value should be .01) So, if your stoploss must be converted to points in order to use OrderSend or OrderModify functions. Quote:
|
|
|||
|
Quote:
Quote:
extern double profit = 80; extern double stop = 30; but backtesting produced t/p stops of 45-46 and stoploss losses of 17 Last edited by trevman2005 : 12-23-2005 at 02:24 PM. |
|
||||
|
Quote:
So, If "ask" is 1.1825 and "profit" is 50then: 1.1825 + (50 * .0001) = 1.1825 + 0.005 = 1.1875 (50 Pips) Quote:
.Did you use Optimization testing mode? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Order Execution Problems with my EA | mrebersv | Metatrader 4 | 6 | 04-01-2007 09:08 AM |
| Problems with EA's. | rodrigojmz | General Discussion | 3 | 02-22-2007 01:15 AM |
| Help, anyone having problems with MT4? | increase | General Discussion | 10 | 12-08-2006 01:06 PM |
| ea problems | Eaglehawk | Metatrader 4 | 3 | 06-13-2006 05:32 PM |