Recoding MT4 Entropy Indicator or Fixing an Entropy Indicator from the C Language

MQL4 Indicators Converting C++ Java Forex

Job finished

Execution time 54 minutes
Feedback from customer
Great!

Specification

I have three versions of an Entropy indicator, but they have problems and need fixing.

One entropy indicator, after attaching it to the chart, after an hour or two disappears.

The other two entropy indicators stays at zero.

I have attached a picture to show what I mean.


So, they need to be remade from the C Language or recoded.


What is Entropy?  "Entropy is a well-known measure of disorder or unavailability of energy in a (closed) system. More entropy generally means less predictability, hence one often tries to minimize it":


Here is the C language program of it:

http://www.foretrade.com/entropy.htm

Definition from http://mathworld.wolfram.com/Entropy.html


The source C code for this indicator which can be compiled with any (free) C compiler:


#include "math.h"

#include "stdlib.h"


__declspec(dllexport) void Entropy (double *price, double *entropy, long int size, long int numbars)

{

double *in, *out, P, G;

long int i,j;

double sumx = 0.0;

double sumx2 = 0.0;

double avgx = 0.0;

double rmsx = 0.0;


in=price;

out=entropy;


for (i=0; i<size; i++)

{

if (i < numbars+1) *out = 3.4e38;

else 

{

sumx = sumx2 = avgx = rmsx = 0.0;

for (j=0;j<numbars+1;j++)

{

sumx += log(*(in-j) / *(in-j-1)) ;

sumx2 += log(*(in-j) / *(in-j-1)) * log(*(in-j) / *(in-j-1));

}

if (numbars==0) 

{

avgx = *in;

rmsx = 0.0;

}

else 

{

avgx = sumx / numbars;

rmsx = sqrt(sumx2/numbars);

}


P = ((avgx/rmsx)+1)/2.0;

G = P * log(1+rmsx) + (1-P) * log(1-rmsx);

*out=G;

}

in++; out++;

}


Here are three failed attempts at making the Entropy indicator attached.  They either disappear and show only previous data, or they are stuck at zero while the previous bars display the correct value of entropy.


Responded

1
Developer 1
Rating
(253)
Projects
358
49%
Arbitration
24
25% / 50%
Overdue
80
22%
Free
2
Developer 2
Rating
(88)
Projects
143
39%
Arbitration
21
19% / 48%
Overdue
30
21%
Free
Similar orders
[8/4/2026 4:54 AM] DR.HassaN: AI Gold Analysis Web Platform Requirements Hello, I would like to build a professional AI-powered web platform dedicated exclusively to Gold (XAU/USD) analysis . This is NOT a trading platform or broker . It is an intelligent analysis platform that provides high-quality trading signals and detailed market analysis. The platform should have a modern, premium design with my own branding
Hello, I am planning to automate my own Gold (XAUUSD) scalping strategy using xCustomEA. Before purchasing xCustomEA and hiring a developer, I would like to know: Whether my strategy can be implemented in xCustomEA. Whether any custom MQL5 coding is required. The estimated cost. The estimated development time. I already have a detailed strategy document and will provide it after the initial discussion. The strategy
Project: GoldScalpBot (already published: https://www.mql5.com/en/code/75652 ) I need an experienced MT5 developer to improve my existing Expert Advisor and its local app bridge. Current stack: - MT5 EA (MQL5) for XAUUSD scalping (EMA/momentum/breakout, ATR SL/TP, London/NY sessions, win-based lot scale, daily loss stop) - Local Node.js HTTP bridge (heartbeat + command queue) for a React Native mobile app
Configuration of The Take profit level , SL Thresholds and Fixed SL According to the Absolute Difference . Deleting Folders which are Not in use . (Minor) (Two Folders) . Making Sure Smooth Live Executions Throughout . Live Chart Only . Code has minor compilation error , project begins after you specify the reason
I have a EA that I used AI to create so of course it's not 100% correct of course because it was build using AI and it can't access meta editor so I know it's errors some where but I want someone to basically clean it all up and make it run correctly.... i do not habe coding experience I will be using AI to verify that everything i asked for is truly in the code before payment... architecture documents and are in the
Project Overview I am looking for an experienced MetaTrader 5 (MT5) Expert Advisor developer to build a professional, production-quality automated trading system from a detailed Software Requirements Specification (SRS). The strategy is based on a custom implementation of the MACD indicator combined with advanced trade management and a proprietary basket/grid recovery methodology. The complete strategy and
I need a custom technical indicator that generates an equidistant channel with two specific structural features: 1. Vertical Multi-Intervals: The ability to plot more than 5 parallel, able to allow me to put intervals 2. Horizontal Angle Input: The ability to manually input geometric angle to strictly define the horizontal slope of the channel or allow me to pick two points manually. i am looking for something like
Here's a natural and professional version in English: Hello, I am looking for an experienced MT4/MT5 developer. I need someone who can provide high-quality service, has strong knowledge of MetaTrader 4 and MetaTrader 5, and responds quickly. If you have experience developing Expert Advisors (EAs), indicators, or scripts, please share your portfolio, relevant experience, estimated cost, and delivery time. I am looking
I need a trading robot for MetaTrader 5 that works on mobile for XAUUSD. === TRADING RULES === Symbol: XAUUSD Timeframe: M15 Trading Hours: 10:00 to 18:00 server time only Buy: When 10 EMA crosses above 50 EMA Sell: When 10 EMA crosses below 50 EMA Close opposite position when new signal appears === RISK MANAGEMENT === Risk per trade: 1% of account balance Stop Loss: 300 points / $3.00 Take Profit: 600 points / $6.00
Jona copilot v12 30 - 40 USD
Hi, I'm interested in ordering an MT4 trading bot. Before we begin, could you please send me the technical specifications and requirements you'll need? Specifically, I'd like to know: - The trading strategy the bot will use. - The currency pairs or instruments it will trade. - The timeframes it supports. - Risk management features (lot sizing, stop loss, take profit, trailing stop, maximum drawdown). - Whether it

Project information

Budget
30 - 35 USD
Deadline
to 3 day(s)