### BrighterTreades:init()
```plantuml
    @startuml
        !theme vibrant
        start
            :Create Exchanges;
            :Create Cache;
            :Create Configuration;
            :Create Signals;
            :Create Candles;
            :Create Indicators;
            :Create Trades;
            :Create Strategies;
            :Create Backtester;
        stop
    @enduml
```
### connect_user_to_exchange():
```plantuml
    @startuml
        !theme vibrant
        start
            if (Exchange Connected?) then (true)
            :Return True;
            stop
            else (False)
            :connect_exchange();
            if (Success?) then (true)
            :Return True;
            stop
            else (False)
            :Return False;
            stop
    @enduml
```

### get_js_init_data():
```plantuml
    @startuml
        !theme vibrant
        start
            :Get_user_specific_data();
            :Get_application_data();
            :Return data;
            stop
    @enduml
```
### get_rendered_data()
```plantuml
    @startuml
        !theme vibrant
        start
            :get_application_data();
            :format_data();
            :Return data; 
        stop
    @enduml
```
### received_cdata()
```plantuml
    @startuml
        !theme vibrant
        start
            if (First candle?) then (yes)
                :set_first_candle();
            elseif (Duplicate?) then (yes)
                :Return None;
                stop
            else (no)
            endif
            :set_new_candle();
            :update_indicators();
            :update_signals();
            :update_trades();
            :update_strategies();
            :format_return_data();
            :Return updates();
        stop
    @enduml
````
### received_new_signal(data)
```plantuml
    @startuml
        start
        if (Validate input) then (error)
            :return error;
            stop
        else (valid)
        :Create new signal;
        :save signal;
        :return input for chaining;
        stop
    @enduml
```

### received_new_strategy(data)
```plantuml
    @startuml
        start
        if (Validate input) then (error)
            :return error;
            stop
        else (valid)
        :Create new strategy;
        :save strategy;
        :return input for chaining;
        stop
    @enduml
```
### delete_strategy(name)
```plantuml
    @startuml
    start
        :delete from cache;
        :delete from storage;
        :return;
    stop
    @enduml
```
### delete_signal(name)
```plantuml
    @startuml
    start
        :delete from cache;
        :delete from storage;
        :return;
    stop
    @enduml
```
### get_signals()
```plantuml
    @startuml
    start
        :get_signals();
        :return signals;
    stop
    @enduml
```
### get_strategies()
```plantuml
    @startuml
    start
        :get_strategies();
        :return strategies;
    stop
    @enduml
```
### config_exchange()
```plantuml
    @startuml
    start
        :connect exchange();
        if (success?) then (no)
            :return False;
        else (yes)
            :update_API_keys();
            :return True;
            stop
        endif
    stop
    @enduml
```
### close_trade()
```plantuml
    @startuml
    start
        :delete from cache;
        :delete from storage;
        :return;
    stop
    @enduml

```
### received_new_trade()
```plantuml
    @startuml
    start
        :Validate_data();
        :Create Trade;
        if (result?) then (error)
        :log error;
        :Return None;
        stop
        else (success)
        :Save Trade;
        :Return trade;
    stop
    @enduml

```
### get_trades()
```plantuml
    @startuml
    start
        :get_trades();
        :return trades;
    stop
    @enduml

```

### adjust_setting()
```plantuml
    
    @startuml
    !pragma useVerticalIf on
    start
        if (setting?) then (interval)
            :set_chart_view(interval);
            
        elseif (setting?) then (trading_pair)
            :set_chart_view(trading_pair);
            
        elseif (setting?) then (exchange_name)
            :set_chart_view(exchange_name);
            
        elseif (setting?) then (toggle_indicator)
            :toggle_indicator();
            
        elseif (setting?) then (edit_indicator)
            :edit_indicator();
            
        elseif (setting?) then (new_indicator)
            :new_indicator();
            
        else
            :Log error;
        endif
        :Save changes;
        :reload price data;
        :return;
        stop
    @enduml

```

### process_incoming_message()
```plantuml
    @startuml
        start
            if (msg_type) then (candle_data)
                :received_cdata();
            elseif (msg_type) then (delete_signal)
            :delete_signal();
            elseif (msg_type) then (delete_strategy)
            :delete_strategy();
            elseif (msg_type) then (close_trade)
            :close_trade();
            elseif (msg_type) then (new_signal)
            :received_new_signal();
            elseif (msg_type) then (new_strategy)
            :received_new_strategy();
            elseif (msg_type) then (new_trade)
            :received_new_trade();
            elseif (msg_type) then (config_exchange)
            :config_exchange();
            endif
            if (msg_type) then (request)
                if (msg_data) then (signals)
                    :get_signals();
                elseif (msg_data) then (strategies)
                    :get_strategies();
                elseif (msg_data) then (trades)
                    :get_trades();
                else (unknown)
                    :log error;
                endif
            endif

        stop    
    @enduml
```