Closed jbax closed 4 years ago
Done. README updated.
The Strategy
interface now has a tradeSide
method
public interface Strategy {
default Trade.Side tradeSide() {
return null;
}
}
A Strategy that only generates
signals relevant for shorting has to return Trade.Side.SHORT
when tradeSide()
is called by the framework.
For signals relevant only for regular (long) trades, tradeSide()
must return Trade.Side.LONG
. If the same strategy
can work for both long and short trades, simply let the default implementation do its job and return null
.
NOTE: Shorting is disabled by default, to enable it, invoke enableShorting()
from
AccountConfiguration;
For live trading with stocks this is one of the common processes:
need to have X amount in account.
short sell up to the equivalent X amount. Additional fees may apply, also might need to close trade before end of trading session to avoid paying interest.
For Binance (and possibly others), you can only do that with a margin account. I'll open a separate issue for this.