Step-by-step guide on how constructor works
This guide is made to explain functional logic for setting up signals. It does not include information about possible strategies made on constructor.
Use case
Constructor is made to fully create cycles between your strategy and exchange. It covers multiple configurations you can configure by using custom template. So we will walk trought advantages you can take by building fully custom templates. We have integrated some default standarts and quick setups, there usage is explained individually.
Cases we will walk trought
Signal verification and entry functions
Use case of settings used to construct main blocks
Functions that can be merged with signal
Functions that can be merged before trade execution
Functions that are nessesary for exchange to work
Parameter usage in calculator and construction in cycle
The main cycle of constructor
Lets walk trought signal verification and entry functions
So if the bot you want to run is capable of listening for signals sent by other software, we need to create custom access point right ? Thats why we created a way to construct message sent by custom signal source, you are able to constrol format of message, choose stricted scheme that other source needs to adapt. You can control almost every parameter that changes the logic of main cycle.
Here are things you have to prepare
* You must have TradingView account.
* You have to setup Authorization.
Definations of settings in main block
It's the main configuration that describes on how the end cycle will work. You can choose between already registered functions with a option to include it or just leave it blank if there is no use case for specific cycle. Most of options in settings depends on exchange based functions, so if you select the value in list, you have to enable specific function that will geather data from and to exchange.
SIGNAL CONTROLED - [BACKTEST, ORDERTYPE, AMOUNTTYPE, STARTPOSITION, TRADEINTERVAL, PROFITCURRENCY, HOOKTYPE, AMOUNTPERCENT, SIGNALALERT, TRADEALERT]
SIGNAL RESTRICTED - [NAME, START DATE, END DATE, SYMBOL]
Complete description of each parameter
BACKTEST
Controls if orders actually completed or saved for statistics. You will have to provide backtest balance manually, it will not depend on actuall information.
NAME
Your prefered name, that will be used to define ownership.
SYMBOL
Market you will trade in, can't be regulated with signals.
ORDER TYPE
You can set limit orders to choose price by yourself or execute with actual market value.
AMOUNT TYPE
Condition of amount calculation, custom will have to be set in calculator, regulated uses percentage of amount, fixed uses whole balance.
START POSITION
Defining first order side that will can be sent with signal.
TRADE INTERVAL
Condition with two options, to recieve signals based on previous order, or by action sent in signal.
PROFIT CURRENCY
Controls statistic and function elements in wich currency earnings will be defined.
HOOK TYPE
Set message format, you can set a object of data or text messages.
AMOUNT PERCENT
Set portion of amount that will be used to trade with, remember if you choose to setup custom template, you will have to define it manually with calculator.
SIGNAL & TRADE ALERTS
You can recieve notifications related to signal and trade entry, it will sent progress from beggining to finish.
START DATE & END DATE
Cycle must have it's term to process further.
Functions that can be merged with signal
We have enabled 3 conditions for signals. Each one has to be prepared individually to work. Once you choose signal type, you have two stages you can include, on signal or trade entry. You have to enable block to access functions, once you enable it. You have to select aditional function that is needed to it to work, in this case it's depended on bot settings.
Functions that can be merged with trade
You have to follow the same steps that are required to setup signal function. Both of options require to enable function block before. Trade functions are depended on exchange functions and main settings to work, exchange will be used to geather/execute data and bot settings will change how the function works.
Functions that are nessesary for exchange to work
Most of actions or depended on this setup, you have to know wich parameters have relation with data depended on exchange. If you use some of signal or trade function blocks, they will need have access to exhange, if you will miss some steps here, your previous selection will be ingored of lack of access.
Parameter usage in calculator and construction in cycle
Calculation used to define logic for values, by standart you have options that are included in specific strategy in bot settings block. When using custom template, you are on full control. Calculator has two conditions, classic or simply formulated value, expression or value depended formulas. We will work around expression method in this guide.
Basic example of expression mode usage
Let's image that we want to create a strategy where we want to place one order right now and every next signal later, with a rule to continue buying with lower price. At first order you will have to send buy order with actual market price and hold it saved. When first order is completed it has to follow 2 conditions, if first order price is larger than actual market price and price is 5% lower than previous, use lower price. If price comes down lower than 5%, use actual price until price comes back up to actual.
Calculate 5% of price
price = previousOrderPrice - (previousOrderPrice * 5)
1 Condition
If previous price is larger than actual, increase amount usage by 25% of balance
price = if(previousOrderPrice > ticker);
value = ((100*0.25) / balance) + previousOrderAmount
2 Condition
If price is belove 5% of price
price = if( ticker < (previousOrderPrice - (previousOrderPrice * 5)));
value = (100*0.25) / balance
3 Condition
Calculate if price is 5% lower and comes back up from bellow
price = if(previousOrderPrice > ticker & ticker > (previousOrderPrice - (previousOrderPrice * 5)));
value = ((100*0.25) / balance) + previousOrderAmount
So the settings are configurated, we are buying when price is lower and changing amount depending on in wich part of range it is.
Definitions of calculator functions
Calculator does not depend on advanced formulas to place data in, you have availability to control logical functions, increasment or decreasment functions.