View Single Post
  #7 (permalink)  
Old 03-30-2006, 12:58 PM
intelligent_14's Avatar
intelligent_14 intelligent_14 is offline
Junior Member
 
Join Date: Mar 2006
Location: Tehran/Iran
Posts: 24
intelligent_14 is on a distinguished road
Quote:
Originally Posted by Willis11of12
static bool ITradedOnThisBar;

Just before opening any trades:

if(ITradedOnThisBar != Bars)
{

Right after opening a sell or buy order:

ITradedOnThisBar = Bars;
Willis11of12's solution is very good, i also use it to prevent multiple orders in the same bar, but it dosen't prevent wrong Order Closes, my solution for that problem is to get a confirmation from MA

when we get a buy signal, the fastEMA crossed the SLowEMA from down, so the close time would be whenever FastEMA cross SlowEMA from up

for simpler coding i write a few code for checking EMA direction, when the EA wants to close the order, EMA direction must be Oposite Open condition
__________________
there wil be nothig for a person exept his efforts (Emam Ali Alayhesalam)
M.A.Gh
Reply With Quote