Thread: Ask!
View Single Post
  #101 (permalink)  
Old 05-14-2006, 08:42 AM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 20,059
Blog Entries: 241
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 cramnhoj
Hi all,

would like to ask how do you facilitate communication between two or more running EAs. What I want to do is maintain a set upper limit on the percentage of equity at risk, and I want several EAs running on different currency pairs. Say the total at risk would be 10% and each trade is set at 1% risk. One way I see this is when an EA has a signal to open a trade, I want it to check a global variable that has the current total percentage at risk, if less than 10%, continue with the trade and increment the global variable (if not, forget the trade).

The question here is if the operation is atomic in execution, what little I remember from college OS concepts is that aside from the global variable containing the percentage at risk I also need a global variable saying whether or not the percentage at risk variable is in use (a lock so to speak). I believe there's a function that sets a value to a global variable but first checks it's current value, this could be used if it's execution is atomic right?

I asked here in case someone has already done this (or remembers their OS concepts course ).
I will be really good to create some script or tool in Metatrader to manage 2 or 3 EAs running (MM, risk, lot sizes and so on). But I don't think that it is easy. It is very difficult. I even can not imagine which kind of program can do it. But it should be very usefull.

Last edited by newdigital; 05-14-2006 at 08:49 AM.
Reply With Quote