Â
List view
Overview
Overview
Price Data
Price Data
Get Started
Â
Create Your First Strategy
Â
🔒 Only subscribed users can create strategies.
Â
Let's create a simple yet effective long-term trend trading strategy. At its core, this strategy uses crossover signals from short-term and medium-term moving averages.
We'll enter the market with a buy order at the market price when the 20-day Exponential Moving Average (EMA 20) crosses above the 50-day Exponential Moving Average (EMA 50). Upon entering, we'll set take-profit and stop-loss points to protect our funds during market fluctuations and lock in profits when we reach our target. This approach combines technical analysis with risk management, offering traders a clear operational framework.
Â
Create Empty Strategy
Open the Pineify Builder and click the "Create" button on the homepage. In the pop-up dialog box, choose the type of strategy you want to create. Then, select the corresponding blank template from the options provided.
Â
Â
Â
Now that we've created an empty strategy, let's proceed step by step to build this exciting trading system! 🥳.
Â
Add Input
We'll create four inputs for our strategy: Fast EMA Length, Slow EMA Length, Take Profit Price Multiplier, and Stop Loss Price Multiplier.
- Fast EMA Length
- Slow EMA Length
- Take Profit Price Multiplier:
Determines the take-profit price as a multiple of the entry price (i.e., closing price). Multiply the entry price by this coefficient to set the take-profit level.
- Stop Loss Price Multiplier:
Determines the stop-loss price as a multiple of the entry price (i.e., closing price). Multiply the entry price by this coefficient to set the stop-loss level.
Â
After completing this setup, you'll see these four inputs in your Inputs panel.
Â
Add Indicator
Next, select indicators in the right panel. You can search for indicators here—in this case, search for EMA and add them.
We need to create two indicators: Slow EMA and Fast EMA.
In the dialog box, simply enter the indicator names and bind the parameters to the corresponding Inputs we've just created. You can also select the style in Plots, such as the color and width of the line.
Â
- Fast EMA
- Slow EMA
Â
Once you've completed this setup, these two indicators will appear in your Indicators panel.
Â
Now, click the "Copy Pine Script" button in the top right corner. Next, create a new strategy in TradingView and paste the copied code. You'll then see the default plots of these two EMAs on the main chart.
Â
Next, let's move on to creating the strategy conditions.
Â
Add Condition
As we're focusing solely on long trades in this strategy, we only need to establish a buy condition.
Â
Â
Once you've completed this setup, the buy condition will appear in your Conditions panel.
Â
The next crucial component of the strategy is the trading logic.
Â
Add Strategy Entry
Click the "Add Strategy" button and select "Entry" to create an entry trade. Here's the information required:
- Type: Specifies the order type. Currently, only market orders are supported for entry.
- Trigger Condition: The condition that initiates the entry. Select the buy signal you just created.
- Direction: Indicates long or short positions.
- Size Type: Determines the order size. You can modify the default value (10% of available equity) in the Properties Tab. Alternatively, adjust it here to buy a specific quantity.
- Alert Message: Defines the content of the alert triggered by the strategy.
Â
Â
Add Strategy Exit
Now, let's create the exit logic for our strategy.
In the Strategies Panel, click the "+" button and select "Exit." Here's the information you'll need to create an exit trade:
Order
- Type: Two exit order types are supported. The first is a market order exit, which requires specifying exit conditions. The second is take-profit and stop-loss orders, set simultaneously upon market entry. For this strategy, we'll choose the TP/SL Order.
- Entry: Specify which Entry the current Exit is associated with, or choose all entries. This parameter allows you to exit a specific Entry.
- Size: The proportion of the position to exit, with a default of 100%.
Â
Â
Take Profit
- Type: Specify either price or number of ticks. We choose price for our strategy's take-profit level. This allows better trade control and ensures automatic profit-taking when the target price is reached.
- Price: Set the take-profit price. Simple expressions using "+", "-", and "*" are supported. We set it to 1.3 times the entry day's closing price. For example, if the entry day's closing price is 100, the take-profit price will be 130.
- Display Line: Toggle the take-profit line visibility. We enable this to see the take-profit line on the TradingView chart. It aids real-time monitoring of the take-profit status and helps evaluate and adjust the strategy's effectiveness.
Â
Â
Stop Loss
- Type: Choose between price or number of ticks. We select "price" for our strategy's stop-loss, allowing better trade control and ensuring automatic execution when the target price is reached.
- Price: Set the stop-loss price. Simple expressions using "+", "-", and "*" are supported. We set it to 0.95 times the entry day's closing price. For example, if the entry day's closing price is 100, the stop-loss price will be 95.
- Display Line: Toggle the stop-loss line visibility. We enable this to see the stop-loss line on the TradingView chart. It aids real-time monitoring of the stop-loss status and helps evaluate and adjust the strategy's effectiveness.
Â
Â
Viewing Backtest Results
After successfully creating the Entry and Exit, click the "Copy Pine Script" button in the top right corner and paste the latest code into the TradingView code editor.
You can now see the strategy and its backtest results displayed on the chart.
Â
Â
Analyze the performance of your strategy by examining the backtest results displayed on the chart. This will help you evaluate its effectiveness and make necessary adjustments.
Â
Through Pineify, you can build any strategy you want using the builder. Start trying it out now~
Â
Discover algorithmic trading with Pineify! Our user-friendly builder lets you create advanced strategies without complex coding. Perfect for beginners and experts alike, Pineify simplifies strategy design, testing, and optimization. From basic to complex systems, the possibilities are vast. Embrace automated trading and elevate your investments. Try Pineify now and shape your trading future!
Â
Â
Â
Â