Thread: Stochastic v1
View Single Post
  #15 (permalink)  
Old 01-12-2006, 11:56 AM
zuhainis zuhainis is offline
Member
 
Join Date: Dec 2005
Posts: 32
zuhainis is on a distinguished road
// it is important to enter the market correctly,
// but it is more important to exit it correctly...
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && // check for opened position
OrderSymbol()==Symbol()) // check for symbol
{
if(OrderType()==OP_BUY) // long position is opened
{
// should it be closed?
if((StochasticGreen<StochasticRed))
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet) ; // close position
return(0); // exit
}

The exit don't check for magic number so the EA tend to close other trade open by other EA(I think). Can somebody fix this please.
Reply With Quote