Strategy tester opening & closing sell trades immediately yet buy trades are okay. What could be the problem?
The logic is that all trades should be closed on opposite signal but only buy trades respect this rule. Sell trades are closed immediately. Buy and sell trades are executed properly when there is a buy or a sell signal, however calling these functions, CloseSellPositions() on Buy signal and CloseBuyPositions() on Sell signal, sell trades are closed immediately they're opened but buy trades are only closed on sell signal. I'm using the CPositionInfo class with post as the position object in the Trade.mqh library. Help.
- How can I use CPositionInfo to determine if an opened trade is a Buy or Sell before I close?
- Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6.
- Problem with pending order in EA
Douglas Mwaura Ndungu:
The logic is that all trades should be closed on opposite signal but only buy trades respect this rule. Sell trades are closed immediately. Buy and sell trades are executed properly when there is a buy or a sell signal, however calling these functions, CloseSellPositions() on Buy signal and CloseBuyPositions() on Sell signal, sell trades are closed immediately they're opened but buy trades are only closed on sell signal. I'm using the CPositionInfo class with post as the position object in the Trade.mqh library. Help.
The logic is that all trades should be closed on opposite signal but only buy trades respect this rule. Sell trades are closed immediately. Buy and sell trades are executed properly when there is a buy or a sell signal, however calling these functions, CloseSellPositions() on Buy signal and CloseBuyPositions() on Sell signal, sell trades are closed immediately they're opened but buy trades are only closed on sell signal. I'm using the CPositionInfo class with post as the position object in the Trade.mqh library. Help.
The full logic is clearly not in the above, so how do you expect anybody to find your error?
and i recommend that you search this site for how to use SelectByIndex
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register