-
Notifications
You must be signed in to change notification settings - Fork 18
Program sequence
Sascha Becker edited this page Jan 17, 2021
·
1 revision
start = async () => {
const start = now();
log.info(`########## Started ichimoku ##########`);
await this.collectRevenue();
const markets: Market[] = await this.getMarkets();
const marketSummaries: MarketSummary[] = await this.getMarketSummaries(
markets
);
await this.evaluateMarkets(marketSummaries.map(({ symbol }) => symbol));
if (this.config.enableReporting && !this.config.debug) {
await this.report();
}
log.info(`########## Finished ${(now() - start).toFixed(5)} ms ##########`);
};
await this.collectRevenue();
- Fetch you current balances
- Only checks assets where available coins are greater than 0
- Ignore assets that you want to HODL see config
- Iterate over every balance
- Fetch current market ticker for this balance (e.g.
ETH-USDT
) - Calculates how much revenue is already earned (current value minus invest)
- When greate than invest try to sell that bit
- e.g. Current value 57 USDT with an invest of 50 USDT -> sell 7 USDT worth
- It can only sell when the quantity will be greater than the minimum trade size allowed by bittrex
- Fetch current market ticker for this balance (e.g.
const markets: Market[] = await this.getMarkets();
const marketSummaries: MarketSummary[] = await this.getMarketSummaries(
markets
);
await this.evaluateMarkets(marketSummaries.map(({ symbol }) => symbol));
- Filter the markets
getMarkets
andgetMarketSummaries
- (if
ignoreTokenizedStocks
) Only use markets which are not tokenized stocks - Only use markets using the
config.mainMarket
hereUSDT
- Only use markets which are
ONLINE
- Check against market summary to see if the quote volume is greater than 0 (market is being traded on)
- (if
- Use those filtered marked for the next step ->
evaluateMarkets
- Iterate over every market
- Ignore HODL markets (just buy some manually and HODL on)
- Get candles
- Count EMA ticks. Positive and negative
- If you got some of that asset in your balance
- If it's on the blacklist it will sell it. E.g. Bittrex delisting coins
- If it got too many negative ticks it will sell it
- If you don't have any of that asset in you balance
- If it's not blacklisted and got the amount of positiv ticks it will buy
Selling: It will be a limit sell with timeInForce: TimeInForce.FILL_OR_KILL
Meaning, either it gets sold directly or the order gets canceled and will be tried next round.
Buying: The positiv ticks need to be exact the value defined in the config. This will prevent buying into a market "too late"
await this.report();
Set enableReporting
in the configuration to report your current state. You will also need to enter your url in api/BittrexApi.ts report()
This could be used to track your bot and how much your balances are worth over time.