trade by retail sentiment

trade by retail sentiment
Download ALL MT4 experts (885)
YouTube Video Thumbnail



Similar MetaTrader Tools

trade by retail sentiment

Info

The trade by retail sentiment is a Expert Advisor for MetaTrader 4 that ziwox retail sentiment expert advisor description: this expert advisor (ea) leverages retail trader sentiment from the ziwox api to make contrarian trading decisions combined with a simple technical filter. the idea is simple: if most retail traders are long, we consider selling, and if most are short, we consider buying.

Usage

This tool is typically used for automated trading on major forex pairs and gold.

Platform

This Expert Advisor works exclusively on MetaTrader 4 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL4/Experts folder via File ? Open Data Folder in MetaTrader 4.


How to Install and Use trade by retail sentiment

1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.

2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.

3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.

4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.

Frequently Asked Questions

Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.

Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.

Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.

What this tool does

ziwox retail sentiment expert advisor description: this expert advisor (ea) leverages retail trader sentiment from the ziwox api to make contrarian trading decisions combined with a simple technical filter.

Typical Use Case

This Expert Advisor excels in automated trading and technical analysis on MetaTrader 4.

Compatible Platform & Setup

This Expert Advisor works on MetaTrader 4. Place the file in the MQL4/Experts folder and restart the terminal.

Description & Settings

Related: Quantora Trade Manager MT4: Advanced Position Management for MetaTrader 4 - another powerful expert for MetaTrader 4 traders.

ziwox retail sentiment expert advisor

Also recommended: Quantora Risk Calculator MT4: Professional Trade Risk and Reward Analysis - similar expert with strong performance on MetaTrader 4.

description:
this expert advisor (ea) leverages retail trader sentiment from the ziwox api to make contrarian trading decisions combined with a simple technical filter. the idea is simple: if most retail traders are long, we consider selling, and if most are short, we consider buying. by combining sentiment analysis with moving average trend confirmation, the ea provides an intelligent approach to trading based on collective market behavior.
code and implement comes from this
why retail sentiment matters:
retail trader sentiment reflects the positions and biases of small traders in the market. it’s widely known that retail traders often take the wrong side of market moves due to emotional trading, poor risk management, or overreacting to news. by analyzing the long and short ratios of retail traders, we can adopt a contrarian strategy, which often aligns with institutional flow and broader market trends.
sentiment analysis can help traders:

identify overextended market conditions.

detect potential reversals early.

enhance technical analysis with behavioral insights.

reduce risk by avoiding crowded trades.

how the ea works:
this ea retrieves retail sentiment data via the ziwox api and combines it with a moving average crossover filter:

api integration:
using the getapi function, the ea sends a web request to ziwox’s endpoint to fetch sentiment data in json format. the data includes key fields such as retail long ratio , retail short ratio , and risk sentiment . the json is then parsed into an array ( apijson ) using jsondataparse .

contrarian logic:

if retail long ratio >= 60% and the fast ma is above the slow ma, the ea considers a sell trade.

if retail short ratio >= 60% and the fast ma is below the slow ma, the ea considers a buy trade. this ensures trades are taken contrarian to retail sentiment but still in line with technical trend confirmation.

technical filter:
simple moving averages ( ima ) with user-defined periods ( shortmaperiod and longmaperiod ) filter trades. only trades that align with the moving average trend are executed.

automated trading:
when autotrade is enabled, the ea automatically opens orders, checks for new candles via isnewcandle() , and ensures no duplicate trades with orderstotal() .

visualization:
the ea draws sentiment indicators on the chart using drawsentiment and buttoncreate , showing retail long and short ratios in a clear, color-coded manner. green indicates long positions, and red indicates short positions.

key code components explained:

getapi : handles api calls to ziwox, manages rate limits, retries, and saves data to a json file.

jsondataparse : reads the json file, parses sentiment values, and stores them in the apijson array for use in trading logic.

ontick : checks conditions each tick, applies contrarian logic with ma trend filter, and sends orders if criteria are met.

drawsentiment & buttoncreate : visualizes sentiment directly on the mt4 chart for instant insight.

isnewcandle : ensures trades are only checked once per new candle to avoid multiple executions on the same candle.

usage instructions:

place the ea in the experts folder of mt4.

input your ziwox api key in the apikey field.

adjust shortmaperiod and longmaperiod as needed.

set autotrade to true if you want fully automated trading.

load the ea on any symbol chart. it will fetch sentiment, visualize it, and trade according to the contrarian strategy.

conclusion:
this ea combines behavioral finance insights from retail sentiment with technical analysis to provide a simple yet effective contrarian trading strategy. by monitoring the collective bias of retail traders, the system helps identify potential market reversals and avoids crowded trades, giving an edge to disciplined traders.

You may also like: e-signal of trade expert advisor - excellent alternative for expert users on MetaTrader 4.

Source Code

яю//+------------------------------------------------------------------+
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version   "1.00"
#property strict
input    bool        AutoTrade      =  false;   // Trade Automatically
input    string      APIKey         =  "";      // Your Ziwox API key
input    string      SymbolPrefix   =  "";      // Your Broker symbol Prefix
input    string      SymbolSuffiex  =  "";      // Your Broker symbol Suffiex
input    int         shortMAPeriod  =  9;       // Slow MA Period

.......

Leave your opinion, ask a question, share some knowledge

Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.