Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Today's Posts


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

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-11-2005, 10:02 AM
yaniv_av yaniv_av is offline
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
Please help !!!

Hi,

I'm writing the simplest code I can but I always get error "Invalid price" when tring opening a position !!!

ex:
Code:
   if (OrdersTotal() == 1) return;
   
   res=OrderSend(Symbol(),OP_SELL,Lots, Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",100,0,Red);
      if(res<0)
       {
        Print("OrderSend SELL failed with error: ",GetLastError());
       }
What can be simple than that ???
And always, for all symbols, I get error 129 !!!

Why ???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-11-2005, 11:18 AM
forexts's Avatar
forexts forexts is offline
Administrator
 
Join Date: Sep 2005
Posts: 290
forexts has disabled reputation
I used this code in Volume Trader:

Code:
		 if ( Volume[1] < Volume[2] ) 
		 {
		 OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,cm,EAMagic,0,White);	 
		 }
		 if ( Volume[1] > Volume[2] )
		 {
		 OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,cm,EAMagic,0,Red);
		 }
Volume trader

Your problems seems to be related to stoploss and take profit.

Try with 0 and if it works, try modifying TakeProfit and StopLoss ... and ... try to show them with an Alert (perhaps value is wrong).

Last edited by forexts : 11-11-2005 at 11:22 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-11-2005, 11:36 AM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 15,222
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
I had the same problem with Brainwashing EAs all the day yesterday:
- Brainwashing #1c USDCHF,M15: Error opening order : invalid price.

Now I know that it might be the following:
- price is moving too fast - slippage. (yesterday especially);
- MT4 build 185 have a bug (big one!).

I uploaded MetaTrader to build 186 and everything is ok now.

Yaniv_av, I think you are using MetaTrader build 184 or 185.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-11-2005, 11:44 AM
forexts's Avatar
forexts forexts is offline
Administrator
 
Join Date: Sep 2005
Posts: 290
forexts has disabled reputation
Quote:
Originally Posted by newdigital
Yaniv_av, I think you are using MetaTrader build 184 or 185.
Or takeprofit/stoploss is very small value
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-11-2005, 11:54 AM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 15,222
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by forexts
Or takeprofit/stoploss is very small value
Yes of course. It may be the reason as well.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-11-2005, 12:07 PM
yaniv_av yaniv_av is offline
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
I think there was a problem with the prev build

that released before a few hours.
I have downloaded the last build released now and it's ok ...

10X all !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump



All times are GMT. The time now is 02:15 AM.