Skip to content

Commit

Permalink
Merge 8f5480e into d01737a
Browse files Browse the repository at this point in the history
  • Loading branch information
Connie-Wild committed Jan 12, 2018
2 parents d01737a + 8f5480e commit aab4cae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/MainLimitChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as _ from 'lodash';
import t from './intl';
import PositionService from './PositionService';
import { calcProfit } from './pnl';
import * as fs from 'fs';

export default class MainLimitChecker implements LimitChecker {
private readonly log = getLogger(this.constructor.name);
Expand Down Expand Up @@ -136,7 +137,10 @@ class MinTargetProfitLimit implements LimitChecker {
}

private isTargetProfitLargeEnough(): boolean {
const config = this.configStore.config;
const { config } = this.configStore;
if (fs.existsSync('./src/opt/minTargetProfitPercent.txt')) {
config.minTargetProfitPercent = Number(fs.readFileSync('./src/opt/minTargetProfitPercent.txt', 'utf-8'));
}
const { bestBid, bestAsk, targetVolume, targetProfit } = this.spreadAnalysisResult;
const targetVolumeNotional = _.mean([bestAsk.price, bestBid.price]) * targetVolume;
const effectiveMinTargetProfit = _.max([
Expand Down

0 comments on commit aab4cae

Please sign in to comment.