Activity
Mon
Wed
Fri
Sun
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
What is this?
Less
More

Memberships

Automated Traders Community

333 members • Free

4 contributions to Automated Traders Community
Choppiness Index as a function
Hey everyone! I've hit a snag with my current EA. I've found iCustom to be a bit of a pain to work with when you need to call an indicator twice for different timeframes, and have decided to simplify my indicators into functions I can call inside the program. The Donchian channels were easy to convert to a function so I pushed ahead with a Choppiness Index. I can't seem to arrive at the same value as the indicator though. Here's my attempt as well as the logic flow: /*Choppiness Index Formula Sum True Range for the past n periods. Divide by the result of the following two steps: Calculate the lowest TrueLow for n periods. Subtract from the highest TrueHigh for n periods. Calculate Log10 of the result then Multiply by 100. Divide the result by Log10 of n.*/ //double ChoppinessIndex(string symbol, ENUM_TIMEFRAMES timeframe, int lookback){ double CI(double InpChoPeriod){ for(int i = 0; i < inpChoPeriod+1;i++){ double AddATR = iATR(_Symbol,PERIOD_H1,1); double SumATR = 0; SumATR = AddATR + SumATR; double HH = iHigh(_Symbol,PERIOD_H1,iHighest(_Symbol,PERIOD_H1,MODE_HIGH,inpChoPeriod,0)); double LL = iLow(_Symbol,PERIOD_H1,iLowest(_Symbol,PERIOD_H1,MODE_LOW,inpChoPeriod,0)); if(i == inpChoPeriod){ double Chop = 100*(log10(SumATR/(HH-LL)) / log10(InpChoPeriod)); return Chop; } } return 0; } For reference, this is the indicator who's values I cannot match: //------------------------------------------------------------------ #property copyright "© mladen, 2018" #property link "mladenfx@gmail.com" #property version "1.00" #property description "Choppiness index" //------------------------------------------------------------------ #property indicator_separate_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_label1 "Choppiness index" #property indicator_type1 DRAW_LINE #property indicator_color1 clrCrimson #property indicator_style1 STYLE_SOLID #property indicator_width1 2 // //---
0 likes • Aug '23
Aha! I got there in the end, so here it is, Choppiness Index as a function call: double Chop(string symbol, ENUM_TIMEFRAMES timeframe, int InpChoPeriod, int StartIndex){ double _log = MathLog(InpChoPeriod)/100.00; for (int i=InpChoPeriod;i>=0;i--){ double atrSum = 0.00; double maxHig = iHigh(symbol, timeframe, iHighest(symbol, timeframe, MODE_HIGH, InpChoPeriod, StartIndex) ); double minLow = iLow(symbol, timeframe, iLowest(symbol, timeframe, MODE_LOW, InpChoPeriod, StartIndex) ); for (int k = 0; k<=InpChoPeriod; k++){atrSum += (iHigh(symbol,timeframe,k) - iLow(symbol,timeframe,k));} double csi = (maxHig!=minLow) ? MathLog(atrSum/(maxHig-minLow))/_log : 0; csi = NormalizeDouble(csi,2); return csi;} return 0;}
What is the minimum return you require from a EA
Given a non-grid, non-martingale EA with a max drawdown of 20% over the past 5 years, what annual return does the EA need to produce for you to consider trading with it? Btw thanks Rene for creating this community!
Poll
13 members have voted
1 like • Aug '23
For a max DD of 20% I'd like to see at least twice the DD as returns
Let's talk about backgrounds!
Just interested to know how we all wound up here. I've been learning to trade for quite a few years now, and shifted to algotrading when I realised that I can cut one of my largest failing points out of my trading: myself! I started with Pinescript and decided MQL5 was going to be a better fit for what I'd like to achieve. I had very limited exposure to programming beforehand, so the learning curve has been steep! But I love a challenge and love learning new things, so it's been enjoyable to see progress below my fingertips and in front of my eyes. So lets hear it: How did you find yourself in this group? Big thanks to René for putting this community together, excited for what we can achieve!
0
0
Next YouTube Video!?
Should I make another mql5 EA review and which one should I look at? Comment below
0 likes • Jul '23
Hey René, I noticed you had a CSetup class in your latest video that seemed to simplify building a list of assets you'd like the program to trade. I'd love to see how that class works in a video! Really enjoying the little hints at OOP you've dropped throughout as well, just enough info to spark creative ideas.
1-4 of 4
Dan M
1
4points to level up
@dan-m-5422
Self taught newb from Oz

Active 819d ago
Joined Jul 27, 2023
Powered by