Forex
Google

Go Back   Forex Trading > Programming > Metatrader Programming
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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
  #361 (permalink)  
Old 04-03-2008, 03:13 AM
wolfe's Avatar
wolfe wolfe is offline
Senior Member
 
Join Date: Jan 2006
Posts: 673
wolfe is on a distinguished road
case 4051: error_string="invalid function parameter value"

Something might not be defined right.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #362 (permalink)  
Old 04-03-2008, 04:00 AM
jlpi's Avatar
jlpi jlpi is offline
Senior Member
 
Join Date: Oct 2006
Posts: 275
jlpi is an unknown quantity at this point
solution

I know why
It is because you use the loop on orders the following way
for(int i=0;i<OrdersTotal();i++)

Then think about what that does. every time you close an order the OrdersTotal() decreases and on the other side i increases. So no surprise that every time half of the orders only are closed as the interval is reduced on each extremity for every iteration.

the correct loop is
for(int i=OrdersTotal()-1; i>=0;i--)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #363 (permalink)  
Old 04-03-2008, 10:08 AM
ys16 ys16 is offline
Junior Member
 
Join Date: Mar 2008
Posts: 8
ys16 is on a distinguished road
Quote:
Originally Posted by jlpi View Post
I know why
It is because you use the loop on orders the following way
for(int i=0;i<OrdersTotal();i++)

Then think about what that does. every time you close an order the OrdersTotal() decreases and on the other side i increases. So no surprise that every time half of the orders only are closed as the interval is reduced on each extremity for every iteration.

the correct loop is
for(int i=OrdersTotal()-1; i>=0;i--)
Thank you very very much!
yours should work!

I will try now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #364 (permalink)  
Old 04-03-2008, 10:42 AM
ys16 ys16 is offline
Junior Member
 
Join Date: Mar 2008
Posts: 8
ys16 is on a distinguished road
After I modify the for loop, the previous broblems were solved out. But now, if I try to close 18 positions altogether, only a few positions could be closed at the first price change. For the other positions, they cannot be closed because of Error 129. Error 129 is Invalid price. As you know, my setting of close price is just simply by using Bid or Ask and also the slippage as big as 10. Therefore, it should work. Could someone tell me where I got wrong?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #365 (permalink)  
Old 04-03-2008, 04:06 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 502
Michel is on a distinguished road
Quote:
Originally Posted by ys16 View Post
After I modify the for loop, the previous broblems were solved out. But now, if I try to close 18 positions altogether, only a few positions could be closed at the first price change. For the other positions, they cannot be closed because of Error 129. Error 129 is Invalid price. As you know, my setting of close price is just simply by using Bid or Ask and also the slippage as big as 10. Therefore, it should work. Could someone tell me where I got wrong?
You shoud use RefreshRates() inside your loop, or, even better, use OrderClosePrice() instead of ASK or Bid
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #366 (permalink)  
Old 04-09-2008, 02:11 AM
MANSTIR's Avatar
MANSTIR MANSTIR is offline
Member
 
Join Date: Nov 2007
Posts: 78
MANSTIR is on a distinguished road
--my problem solve-- thanks

Last edited by MANSTIR : 04-25-2008 at 02:10 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #367 (permalink)  
Old 04-13-2008, 04:38 PM
fxtrader625's Avatar
fxtrader625 fxtrader625 is offline
Member
 
Join Date: Nov 2006
Posts: 40
fxtrader625 is on a distinguished road
EA needed to read or write RegistryKey values

Hi,

I need an EA to write a value in RegistryKey and an EA to read this RegistryKey value from. This is used for a demo account triggering other accounts to start trading, just in order to filter out bad trades.

Hint: use "advapi32.dll" (in Windows/System32 folder) to import in MQL4 script, and add some functions to read or to write RegistryKey values.

Thanks,
Jeff
__________________
Links about my trading signals:

Filtered FX trades
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #368 (permalink)  
Old 04-16-2008, 12:36 PM
Pucio Pucio is offline
Senior Member
 
Join Date: Sep 2007
Location: Poland
Posts: 201
Pucio is on a distinguished road
Need help with Alert

Hi

I wrote Alert but it only works when I open window with my indicator. It works only also when I jump beetwen charts windows, in other words when I jump between charts time levels. It seems that indicator can not count when whorks. How can I solve my problem ? Need help. Is it conected with Indicatorcounted ? Should I do something in parameter of Alert. How to do it ?

Should I use something like:

double

? = ObjectGetValueByShift(string name, int shift));

if (???????????)

Alert("Pattern on " + Symbol() + " " + Period());




Pucio
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #369 (permalink)  
Old 04-16-2008, 01:02 PM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 15,160
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
Which indicator you are trying to alert?
I can not help a lot.
I am having this example as alert once only.
So, you can look at do the same.
But I do not think that I can help in case of patterns and objects.
Attached Files
File Type: zip alert_once.zip (1.3 KB, 5 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #370 (permalink)  
Old 04-17-2008, 03:58 PM
etrade's Avatar
etrade etrade is offline
Senior Member
 
Join Date: Aug 2007
Posts: 234
etrade is on a distinguished road
Question

I have a question

how to modify an indicator code to display signals a little bitter higher than the price .... I mean increasing the distance between the signal and price
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning Cycles For New Traders Dan7974 General Discussion 350 01-18-2008 06:04 PM
Learning to code for autotrading GoatT Metatrader Programming 8 01-10-2007 08:55 PM
Self learning expert mrtools Expert Advisors - Metatrader 4 32 10-22-2006 05:29 PM


All times are GMT. The time now is 10:00 PM.