Help adding Input for Custom Indicator Object Create String
I have managed to get this to work sort of, I am trying to add functionality so when i drop this indicator on chart an input box comes up to select HIGH or LOW and then a Number
So "My Custom Text (HIGH or LOW) n" as a string on right of chart
Any help would be appreciated
Code so far!
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
ObjectSetText("ObjName","MY TEXT HERE 1",12, "Arial Black", Black);
ObjectSet("ObjName", OBJPROP_CORNER, 0);
ObjectSet("ObjName", OBJPROP_XDISTANCE, 5);
ObjectSet("ObjName", OBJPROP_YDISTANCE, 100);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
I have managed to get this to work sort of, I am trying to add functionality so when i drop this indicator on chart an input box comes up to select HIGH or LOW and then a Number
So "My Custom Text (HIGH or LOW) n" as a string on right of chart
Any help would be appreciated
Code so far!
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
ObjectSetText("ObjName","MY TEXT HERE 1",12, "Arial Black", Black);
ObjectSet("ObjName", OBJPROP_CORNER, 0);
ObjectSet("ObjName", OBJPROP_XDISTANCE, 5);
ObjectSet("ObjName", OBJPROP_YDISTANCE, 100);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+