Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/common/common.es6
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,13 @@ const trade_types = [{
name: 'Goes Outside'
}];

export { trade_types };
const SUPPORTED_CONTRACT_TYPES = Object.freeze([
'up/down',
'touch/no touch',
'in/out', 'digits',
'asians',
'rise/fall equal',
'lookbacks'
]);

export { trade_types, SUPPORTED_CONTRACT_TYPES };
5 changes: 3 additions & 2 deletions src/trade/tradeDialog.es6
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import $ from 'jquery';
import moment from 'moment';
import windows from 'windows/windows';
import rv from 'common/rivetsExtra';
import { SUPPORTED_CONTRACT_TYPES } from 'common/common';
import liveapi from 'websockets/binary_websockets';
import chartingRequestMap from 'charts/chartingRequestMap';
import html from 'text!trade/tradeDialog.html';
Expand Down Expand Up @@ -1014,12 +1015,12 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) {
.uniq()
.value()
// TODO: Remove this filter after implementing reset, high/low, spread, runs contracts.
.filter(f => !/reset|high\/low|spread|run/.test(f.toLowerCase()))
.filter(f => SUPPORTED_CONTRACT_TYPES.includes(f.toLowerCase()))
.forEach(x => {
let y = {};
y.contract_category_display = x;
let contract_object = _.find(available, {contract_category_display: x});
if(contract_object){
if (contract_object) {
y.contract_category = contract_object.contract_category;
state.categories.array.push(y);
}
Expand Down