Visual strategy designer to create a simple trade bot using RSI and MA indicators

    • haasscript
    • ma indicator
    • pinescript
    • rsi indicator
    • simple trade bot
    • visual scripting
    • visual trade bot designer
    posted 3 years ago
    by evergreen
    Tutorial Featured Image


    In this quick and simple guide we will be going through the steps of using HaasScript and our visual strategy editor to generate signals with RSI & MA technical indicators, stop loss at a defined price, ensure we overcome trade fees, and backtesting the script to see how it performs with historical price data.

    Getting Started

    Before we get started you will need:

    • An active simple or advanced license for HaasOnline Trade Server
    • Hardware that meets our software's minimum specifications
    • Broadband internet

    If you don't have access to one or more of the above, you can choose to test on one of our demo servers. Please remember these machines are public and you should never add any private information.

    Creating the Strategy

    We start by creating a new script with the trade bot template, creating a unique name, and adding a description (optional).

    Once we've created our new trade bot using the template, it's ready to be configured in the visual designer. A trade bot strategy is comprised of multiple components which includes containers for safeties, insurances, technical indicators, and the trade bot itself.

    If you want to add or explore additional blocks, search the commands for what you're looking for to quickly add the new blocks as seen in the illustration below. Once you've added the blocks and arranged them how you like, you will need to connect the blocks to their corresponding counterpart. Do this by clicking the starting and ending points as seen below.

    Now that we have created the base for our visual trading bot, we can begin by adding the technical indicators we want to use to generate signals. In this specific case we've chosen EasyMA and EasyRSI, but you may wish to use a different combination of indicators. Once you've selected your technical indicators you have to connect them to the indicator container. The indicator container merges all their signals and determines a consensus signal to be processed by the trade bot container.

    Now we want to configure actions based on the signals being generated. We need to add a safety to our script and we've chosen Stop Loss, however HaasScript has dozens of other options to choose from including Trailing Stop Loss, Deactivate After X Trades, Take Profit, and so on. After we've added our Stop Loss block, we need to pass it some settings and to do that we use the "Input" block with a label and value. Once all those are configured you need to connect the dots back to the Safety Container so that it can process the Stop Loss signals.

    Now that the majority blocks of our trade bot have been added and connected. We want to refine our strategy to make sure that our trades at the very minimum cover the cost of the trade fees. We do this by using an insurance, specifically the Overcome Fee Costs insurance.

    Now to test all of our hard work. Check your default settings in the left-hand menu to make sure you're using your desired exchange, pairs, intervals, etc. Once you've verified those settings, save your script, then use CRTL+R to run your backtest to see if you're getting your desired results.

    Example Video


    We hope this quick and simple guide gives you a better understanding of what HaasScript is capable of.

    If you enjoyed this guide or have comments please post them down below.

    — Evergreen

Be the first to comment

The community content is generated by people from the community and is actively moderated. However, we do not endorse or claim to maintain any user generated content, links, tutorials, guides, projects, or questions that may appear in community sections.