Framework & template · MT4

Swing NNFX Framework

by BenoitDurandIndep

This MetaTrader 4 framework provides a modular environment for developing and backtesting expert advisors based on the No Nonsense Forex methodology.

GitHub stars2
Forks0
Last update3 years ago14 Oct 2022
LicenceGPL-3.0

Overview

Swing NNFX Framework includes functional swing trading robots that utilize baseline indicators, multiple confirmation layers, and volatility filters to identify entries. The system features flexible risk controls, including ATR-based stop losses, trailing stops, and pyramiding for scaling into positions. A key component is its integration with SQL databases to manage and analyze large-scale backtesting results across millions of historical scenarios.

Details

Author

BenoitDurandIndep on GitHub

Type

Framework & template

Platform

MetaTrader 4 (MQL4)

Strategy

Trend following, Multi-strategy

Markets

Forex, Indices

Timeframes

H4 and above, M15-H1

Risk profile

No grid, martingale or hedging logic was found in its code or README. That says nothing about how it performs: backtest it first.

Input parameters

Read from Swing_NNFX_Index.mq4. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
I_Open_Time_1string315-2100Start-End of robot activating to search for entry points
I_RetestboolfalseIf we retest entry during the day looking for good entry point
I_Mode_Entryint0Entry mode : 0="wait candle's close" 1="enter the day of the candle" 2="both"
I_PeriodstringD1Time unit to calculate indicators
I_Input_BaseLinestringMMS2_close_sens:1,20,1Baseline indicator
I_Check_Distance_BLstringDistance_BL_Go:MMS$20#0,1440,14,1if we need to check price is not too far from BL
I_Check_Cross_BLstringMMS2_close_go:1,20,1,1Baseline check cross indicator
I_Input_Conf_1stringBullsVsBears_Go:14,0.01,#SHIFT-1-7,1Confirmation indicator 1
I_Input_Conf_2stringAroon_Direction:14,1Confirmation indicator 2
I_Input_VolatilitystringWAE_En_Cours:150,15,15,0Volatility indicator
I_Input_Exit_1stringSSL_Channel_Go:10,1,1Exit indicator 1
I_Input_Exit_2stringExit indicator 2
Show all 38 inputs
NameTypeDefaultDescription
I_Mode_SLint1mode for SL 0="lowest on n candles" 1="ATR"
I_Nb_Cand_SLstring14mode 0 : nb cadles mode 1 param of ATR
I_Coef_ATR_SLdouble1.5coef of SL in mode 1
I_Coef_ATR_SL_Mindouble1.5if we need a minimal SL for safety I_SL_Min*ATR_4H(12)
I_Risque_Max_Valdouble50max risk in absolute
I_Risque_Pctdouble5risk in %
I_Mode_Trailingint1trailing mode with ATR (0 high/low,1 ATR,2 fix)
I_Coef_ATR_Trailingdouble2.0coef of trailing with ATR
I_PourCent_Closeint100% of the position to close
I_PourCent_Pyramint50% of risk to scale in
I_Spread_Limitdouble600.0max spread to enter
I_Debug_Modeint1debug mode 0="no debug log" 1="debug logs activated"
I_Prefixe_Magicint1500000prefix magic number to change for every advisor
I_MovingTPboolfalsedo we move TP when SL moves
I_BaseTPint10000points to calculate fix TP
I_Strat_GoalTPstring66-BE*66-50Money management strategy, exit calculated from R ex : 50-BE*100-40-200-30
I_isBackTestboolfalseif it's a backtest
I_ModeCloseint2Exit mode : 0 no exit, 1 exit only if winning, 2 exit even if losing
I_useStackboolfalseif we scale in position
I_Input_Stack_1stringScale in indicator 1
I_BTScenarioint1backtest scenario to load from file
I_BTFilestringFile name with the scenarii
I_Mode_BLintfalseBase Line mode 0: no BL 1:full 2-7: partial see below
I_Bypass_Logboolfalsedo not print logs in a comment file
I_Continuationboolfalseuse continuation trades
I_Direction_filterstring"BUY" / "SELL / "BOTH" if we filter the order type with only one direction

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone BenoitDurandIndep/fwk-ea-mt4 from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL4/Experts.
  3. 3Copy the filesCopy the .mq4 file into Experts, and any .mqh files into the Include folder the code expects.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar expert advisors

HpFX Framework

by mbelgin
1 stars

High Performance Forex (hpFX) is an indicator-agnostic framework for MetaTrader 4 designed for large-scale backtesting and strategy automation. It allows traders to define complex rules by combining up to ten custom indicators as entry signals, confirmation filters, or exit triggers using a flexible string-based encodi

MT4 Framework & template Trend followingIndicator crossoverMulti-strategy
Updated 3 months ago MIT GitHub repository of HpFX Framework
36 stars

This repository contains the MQL source code used by Forex Strategy Builder Professional to export automated trading strategies to MetaTrader 4 and MetaTrader 5. It serves as a standardized template for executing technical strategies generated by the software, handling order execution and trade management. The EA inclu

MT4MT5 Framework & template Multi-strategyMartingale High risk
Updated 4 years ago None stated GitHub repository of FSB Pro Expert Advisor
7 stars

This MetaTrader 4 expert advisor provides a robust framework for developing automated trading strategies. It includes pre-built modules for trend detection using ADX and Moving Averages, alongside pullback entry logic. The template emphasizes risk management, featuring percentage-based lot sizing and adaptive volatilit

MT4 Framework & template Trend followingMean reversionMartingale High risk
Updated 5 years ago None stated GitHub repository of Falcon Trading Bot Template

Framework4o

by Capital-Advisory-Technology
2 stars

Framework4o is a modular system building framework and expert advisor for MetaTrader 4. It provides a structured environment for developing trading models with pre-defined modules for position and risk management. The core functionality handles entry and exit logic using indicators like DEMA, EMA, and RSI. It includes

MT4 Framework & template Trend followingIndicator crossover
Updated 2 years ago GPL-3.0 GitHub repository of Framework4o
2 stars

This MetaTrader 4 expert advisor and modular framework provides advanced trade management and position scaling capabilities. It features a linear trailing stop that triggers at a predefined profit level and a pyramiding system to add positions to winning trades using a lot multiplier. The code is structured as a librar

MT4 Framework & template Trend followingIndicator crossoverGrid High risk

Gartal Inc

by bsAmirHeydar
1 stars

Gartal Inc is a modular trading automation framework and strategy development template for MetaTrader 4. It provides a structured environment for testing various entry and exit logic, including Fair Value Gaps, moving average crossovers, and Donchian channels. The repository focuses on backtesting workflows, featuring

MT4 Framework & template SMC / ICT / price actionIndicator crossoverTrend following
Updated 3 months ago None stated GitHub repository of Gartal Inc

More frameworks and templates

Need a broker for MT4?

Compare regulated brokers that support MetaTrader, with spreads, minimum deposits and leverage side by side.

Compare brokers