I have been trying to add a custom BB_PRC-1 indicator in my Ea, it gets displayed but the values of the lines are empty. can you help me?
My code is:
and BB_PRC-1 indicator:
int init() { //---- indicators SetIndexBuffer(0,bol); SetIndexStyle(0,DRAW_LINE,EMPTY,2); SetIndexEmptyValue(0,0.0); SetIndexBuffer(1,ma); SetIndexStyle(1,DRAW_LINE,EMPTY,1); SetIndexEmptyValue(1,0.0); IndicatorShortName("BB PRC RANGE v1"); //---- return(0); }
double red_line = iCustom(_Symbol, _Period, "BB_PRC-1", bPer, bDev,maPer, maMeth, useAlerts, alertBar, alertSleep, 0,1 ); double yellow_line = iCustom(_Symbol, _Period, "BB_PRC-1", bPer, bDev,maPer, maMeth, useAlerts, alertBar, alertSleep, 1,1 );
There is nothing wrong with this program.
Maybe there is a problem in some other part, but who knows?
Try the attached program.
There is nothing wrong with this program.
Maybe there is a problem in some other part, but who knows?
Try the attached program.
No luck, i get empty indicator window with your program...
No luck, i get empty indicator window with your program...
My program is not designed to display lines, so it will only display an empty window.
It's impossible to help you, because no one has ever seen your program.
My program is not designed to display lines, so it will only display an empty window.
It's impossible to help you, because no one has ever seen your program.
I just wanted to import this indi above in an empty EA, and i have printed values... but they are 0
here you go.. my program:
//+------------------------------------------------------------------+ //| test.mq4 | //| Copyright 2021, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2021, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict extern int bPer=20,bDev=2,maPer=50,maMeth=MODE_EMA; extern bool useAlerts=true; extern int alertBar=1; extern int alertSleep=1800;//in seconds //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- double red_line = iCustom(_Symbol, _Period, "BB_PRC-1", bPer, bDev,maPer, maMeth, useAlerts, alertBar, alertSleep, 0,1 ); double yellow_line = iCustom(_Symbol, _Period, "BB_PRC-1", bPer, bDev,maPer, maMeth, useAlerts, alertBar, alertSleep, 1,1 ); PrintFormat("red line(%g), yellow line(%g)", red_line, yellow_line); } //+------------------------------------------------------------------+
I just wanted to import this indi above in an empty EA, and i have printed values... but they are 0
here you go.. my program:
First of all, your indicator is wrong. The return "Buffers" value does not exist. Also the bar does not follow. Your indicator has been corrected and the Expert has been re-adjusted. Good luck with.
First of all, your indicator is wrong. The return "Buffers" value does not exist. Also the bar does not follow. Your indicator has been corrected and the Expert has been re-adjusted. Good luck with.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have been trying to add a custom BB_PRC-1 indicator in my Ea, it gets displayed but the values of the lines are empty.
Indicator works fine, and displays correct values in data window. But when i try to get values with iCustom i get 0 or EMPTY values for both lines... can you help me?
My code is:
and BB_PRC-1 indicator: