Hi. I am seeking validation on a strategy from some experienced traders. The strategy is simply to avoid negative swap trades when it is best to do so. When I refer to negative swaps I am referring to trades involving open positions that if left past roll over time, will incur a charge. Still, one just can't exit all negtive swaps because there are negative swap trades that should not be exited/closed because the charge is so small, even though negative. It is more beneficial to leave those open past rollover.
The plan is to first compare the cost of the negative swap with the cost of the spread. For instance, if the negative swap charge( OrderSwap() ) is higher than the spread, then the position is closed just before rollover. If the spread cost is higher than the negative swap charge, then the position is left open past rollover. Is this a sound strategy?
Just in case anyone needed to see how this translates into code, here is an example:
//assume OrderSelect previously called and you already know you are in a negative swap
string currentsymbol = "EURUSD";
string accntcurrency = AccountInfoString(ACCOUNT_CURRENCY);
double newposition = 1;
double contractsize = SymbolInfoDouble(currentsymbol,SYMBOL_TRADE_CONTRACT_SIZE);
double orderswap = OrderSwap();//this assumes OrderSwap() is in account currency, if not it must be converted to account
double mag_currentcost = MathAbs(orderswap);//current order swap in account currency
double currentspread = ask-bid;
double cost = currentspread * newposition * contractsize;
cost = convertcurrency(cost,currentsymbol,accntcurrency);//please see previous posts for this function
mag_commission = MathAbs( OrderCommission() );//current order commission is in account currency
mag_newcost = MathAbs(cost)+ mag_commission;
if( mag_currentcost > mag_newcost )
//Close the order get out of here OR Close now and reopen after Rollover
//P.S. I have "mag_" prefix in the variables to imply "magnitude".