Hi there guys.
someone help me and tell me how I can change this indicator to use ONLY 1minute timeframe data in it´s calculation, regardless of timeframe it
is loaded in?
Those are pascal willain effective volume formula, but the code is not correct because Pascal uses 1 minute data for the calculation of
effective volume. I knew there was something wrong with the lines being plotted, I looked into the formula in metaeditor and I can see the code
only uses the term "bars", there is no reference to timeframe anywhere.
Or pay someone. Top of every page is the link Freelance. Hiring
to write script - General - MQL5 programming forum
I was analyzing the code of another indicator that has multi time frame selection (so the indicator can plot 1h data on 5m chart, for
example), as far as I could tell, there was only one line of code that was giving the instruction:
extern ENUM_TIMEFRAMES BTF = PERIOD_CURRENT;
Then I copied it and pasted on the code of the indicator that I want to use 1minute timeframe data only in it´s calculation:
#property copyright "Copyright © 2018, Gehtsoft USA LLC"
#property link "http://fxcodebase.com"
#property version "1.0"
#property indicator_buffers 1
#property indicator_color1 Green
#property indicator_label1 "Plot"
extern ENUM_TIMEFRAMES BTF = PERIOD_CURRENT; (HERE IS WHERE I PASTED THE LINE OF CODE FROM THE OTHER INDICATOR)
input double PI = 0;
string GenerateIndicatorName(const string target)
string name = target;
int try = 2;
while (WindowFind(name) != -1)
name = target + " #" + IntegerToString(try++);
IndicatorName = GenerateIndicatorName("Cumulative Effective Volume");
IndicatorObjPrefix = "__" + IndicatorName + "__";
if (Bars <= 1)
int ExtCountedBars = IndicatorCounted();
if (ExtCountedBars < 0)
int limit = Bars - 2;
int i = limit;
while (i >= 0)
Raw[i]= ((Close[i]-Close[i+1] +PI)/(HighPrice-LowPrice +PI )) *Volume[i];
i = limit;
while (i >= 0)
Plot[i]= Plot[i+1]+ Raw[i];
I pressed to compile and it did it with no errors. Well I loaded the indicator on a chart and for my surprise there was another option on
indicator settings to choose the timeframe, but it does not matter what timeframe you choose on the settings, nothing happens, the data
plotted keeps the same.
Of course nothing changed - all you did was add an unused input variable.
You're going to have to convert your bar index to the timeframe (BTF) index and stop using the predefined variables
(current TF only.)
Don't mix apples