May 30, 2025
How to Build Your First Trading Strategy In 5 Minutes
A simple GBPJPY strategy with automation using Profectus AI no-coding.

If you're new to trading automation, building your first strategy can feel overwhelming. But with Profectus AI, it’s never been easier to bring your ideas to life, no coding required.

In this quick guide, you’ll learn how to build a fully automated trading strategy for GBPJPY on the 1-hour chart, complete with entry rules, trade filters, and trailing stop management, all in under 5 minutes.

Let’s dive in.

Strategy Setup

Symbol: GBPJPY

Timeframe: 1 Hour (H1)

Entry Condition:

  • Only check trades once per hour
  • Only on Monday and Tuesday
  • Entry is triggered when the previous candle closes above the Bollinger Band middle line
  • Entry is a buy stop order placed at the high of the previous candle
  • Risk: 1% of account
  • Includes Stop Loss and Take Profit

Trade Management:

  • Every candle close, check if the trade is floating more than 1% in profit
  • If true, move Stop Loss to candle low of Candle ID 5 (trailing SL)

Step-by-Step in Profectus AI

1. Trigger Block – Run Per Candle

Start with the "Run Per Candle" block. This tells the algorithm to execute logic on every candle close — exactly once per hour. No repetition, no missed checks.

2. Add a Time Filter – Run in Session

Use the "Run in Session" block to limit trading to the hours between 09:00 and 20:00, and only on Monday and Tuesday.

3. Define the Entry Condition – Bollinger Band Break

Now, let’s build the trading rule:

  • Left Side Select: “Candle Close of Candle ID 1”
  • Right Side Select: Above the Bollinger Band Middle Line

🔎 In candle logic, Candle ID 1 is the most recently closed candle. Candle ID 2 is the one before that, and so on. ID 0 refers to the current candle, which is still forming, we don’t use that for logic to avoid false signals.

4. Prevent Duplicate Orders – Count Trades Block

Use the "Count Trades" block to check:

  • No open trades
  • No pending orders

This avoids multiple positions stacking up and ensures clean, rule-based execution.

5. Place the Order – Buy Pending Block

If all conditions pass:

  • Use Buy Pending Order
  • Entry Price: High of Candle ID 1
  • Risk: 1% of account
  • Add Stop Loss and Take Profit values as needed

Your core strategy is now fully functional.

Adding Trade Management – Trailing Stop Logic

Let’s enhance it with smart risk control:

1. Run Per Candle

Add another “Run Per Candle” block to manage trades every hour.

2. Select Current Position

Use a block to select your currently open trade(s).

3. Check Floating Profit

If the floating profit > 1%, it’s time to trail your stop.

4. Adjust Stop Loss Dynamically

Use the “Modify Trade” block to move your stop loss to:

  • Candle Low of Candle ID 5

This creates a dynamic trailing stop based on structure, giving your trades room to breathe while locking in gains when the move continues.

Export & Test in MetaTrader 5

Now that your strategy is ready:

  1. Click Export to generate your .mq5 file.
  2. Open the file using MetaEditor (part of MetaTrader 5).
    If you don’t have MetaTrader 5 yet, download it from your broker or metatrader5.com.
  3. In MetaEditor, click Compile.
  4. Your compiled .ex5 file will appear automatically in the Experts section of MetaTrader 5.
  5. Now you're ready to backtest your strategy using MetaTrader’s strategy tester.

Final Thoughts

In just a few minutes, you've built:

  • A smart strategy with clear entry rules
  • Proper risk and time filters
  • Automated trade execution
  • A trailing stop-loss system

You didn’t write a single line of code — and yet you created a trading algorithm powerful enough to run on the same infrastructure used by professional traders.

Profectus AI is built to turn your ideas into income. 

Are you ready to build your next one?