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
4 changes: 2 additions & 2 deletions src/botPage/view/blockly/blocks/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ const getActiveMarket = markets =>
{}
);

fieldGeneratorMapping.MARKET_LIST = () => () => {
fieldGeneratorMapping.MARKET_LIST = () => {
const markets = getActiveMarket(symbolApi.activeSymbols.getMarkets());
return Object.keys(markets).map(e => [markets[e].name, e]);
};

fieldGeneratorMapping.SUBMARKET_LIST = block => () => {
const markets = getActiveMarket(symbolApi.activeSymbols.getMarkets());
const marketName = block.getFieldValue('MARKET_LIST');
if (marketName === 'Invalid') {
if (!marketName || marketName === 'Invalid') {
return [['', 'Invalid']];
}
const submarkets = getActiveSubMarket(markets[marketName].submarkets);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ export default () => {
init: function init() {
duration(this);
payout(this);
prediction(this);
barrierOffset(this);
secondBarrierOffset(this);
this.setInputsInline(false);
this.setPreviousStatement(true, 'Condition');
},
Expand Down
2 changes: 1 addition & 1 deletion src/botPage/view/blockly/blocks/trade/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const marketDropdown = block => {
block
.appendDummyInput('MARKETDEFINITION')
.appendField(`${translate('Market')}:`)
.appendField(new Blockly.FieldDropdown(fieldGeneratorMapping.MARKET_LIST()), 'MARKET_LIST')
.appendField(new Blockly.FieldDropdown(fieldGeneratorMapping.MARKET_LIST), 'MARKET_LIST')
.appendField('>')
.appendField(new Blockly.FieldDropdown(fieldGeneratorMapping.SUBMARKET_LIST(block)), 'SUBMARKET_LIST')
.appendField('>')
Expand Down
11 changes: 1 addition & 10 deletions static/xml/main.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<xml xmlns="http://www.w3.org/1999/xhtml" collection="false">
<block type="trade" id="xgH69|xFn9=70w.*3Vo@" x="0" y="0">
<field name="MARKET_LIST">volidx</field>
<field name="SUBMARKET_LIST">random_index</field>
<field name="SYMBOL_LIST">R_100</field>
<field name="TRADETYPECAT_LIST">callput</field>
<field name="TRADETYPE_LIST">risefall</field>
<field name="TYPE_LIST">both</field>
<field name="CANDLEINTERVAL_LIST">60</field>
<field name="TIME_MACHINE_ENABLED">FALSE</field>
<field name="RESTARTONERROR">TRUE</field>
<statement name="SUBMARKET">
<block type="tradeOptions" id="x=V33~4Lb|(sLv`J[:Eb">
<field name="DURATIONTYPE_LIST">t</field>
Expand All @@ -29,7 +20,7 @@
<block type="before_purchase" id="i-CIx.(Onm4?ihxzA}Y]" x="0" y="301">
<statement name="BEFOREPURCHASE_STACK">
<block type="purchase" id="W6q#Z-I3q3d[d3-`S[dS">
<field name="PURCHASE_LIST">CALL</field>
<field name="PURCHASE_LIST"></field>
</block>
</statement>
</block>
Expand Down