I am working on an EA, which I know would be very profitable, but I have a problem.
In Sell Position : it sells in a right place but for exit of that sell it close 13 pips above the right place.
the code for alosing is : [[[[ OrderClose(Ticket,Cls_Lot,Ask,2) ]]]]
please see the attachement for sell
In Buy Position : it buys 13 pips above the right place. but it closes in a right place.
the code for alosing is : [[[[ OrderBuy(Ticket,Cls_Lot,Bid,2) ]]]]
please see the attachement for buy
I know that Buy never open wher I want and sell will nevever close where I want, having different of spread is ok which is 3 pip, not 13 pip.
but I am testing it when market is close, are you sure that when market is close last spread happend to be 13 pip? how could I check that?
Spreads typically open up on a Friday evening just before the markets close . . . if you want to check your current spread add this to your code or create a simple script . . .
Print("Spread = ", Ask-Bid); // or . .
Print("Spread = ", MarketInfo( Symbol(), MODE_SPREAD) );
. . . the last spread value on Friday evening is what the Strategy Tester will use throughout the weekend . . there are ways round this . . do a search.