SungSungE: I try use iCustom(...,ea-signal-indicator_B). Don't know how to update
input variable of iCustom indicator .
- Show us your attempt (using the CODE button)
and state the nature of your problem.
No free help 2017.04.21 - You don't. Get your handle in OnInit with your input variables. № 1
William Roeder:
- Show us your attempt (using the CODE button)
and state the nature of your problem.
No free help 2017.04.21 - You don't. Get your handle in OnInit with your input variables. № 1
date generate in Expert
Expert.mqh extern double g_money_max_lots; bool CExpert::Processing(void) { g_money_max_lots=m_money.ShortSL(0.0); }
link indicator by signal
double k_big_macd_main_color; bool CSignalMACDOP::InitMACD(CIndicators *indicators){ custom_indicator_handle1 = iCustom(m_symbol.Name(),m_period,"tailing\\nonLagMA_LB",PRICE_CLOSE,30,0,0.0,0.0,0,2.0,14,972,k_big_macd_main_color);//1.50 if(!indicators.Add(GetPointer(m_MACD2))) { printf(__FUNCTION__+": error adding object"); return(false); } //--- set parameters of the indicator //--- set parameters of the indicator MqlParam parameters2[5]; parameters2[0].type=TYPE_STRING; parameters2[0].string_value="tailing\\ColorMACD.ex5"; parameters2[1].type=TYPE_INT; parameters2[1].integer_value=my_period; parameters2[2].type=TYPE_INT; parameters2[2].integer_value=m_period_fast; parameters2[3].type=TYPE_INT; parameters2[3].integer_value=m_period_slow; parameters2[4].type=TYPE_INT; parameters2[4].integer_value=m_period_signal; //--- initialize object if(!m_MACD2.Create(m_symbol.Name(),0,IND_CUSTOM,5,parameters2))// { printf(__FUNCTION__+": error initializing object"); return(false); } custom_indicator_handle2 = m_MACD2.Handle(); if(custom_indicator_handle1){ int sub_window = ChartIndicatorsTotal(0,1);// 图表 id 子窗口数量 if(!ChartIndicatorAdd(0,sub_window +1 ,custom_indicator_handle2)) PrintFormat("Failed to add MACD(Bing) on chart. Error code %d",GetLastError()); } if(!m_MACD2.NumBuffers(4)) return(false); } bool CSignalMACDOP::CompareMaps(int map,int count,bool minimax,int start){ k_big_macd_main_color = Main(0); }
output display indicator
//---- input parameters input ... input double money_lots = 2.0; // Number to make objects unique extern double g_money_max_lots; int OnInit() { if( panel_disp_ptr==NULL ){ // this should always be true panel_disp_ptr = new InformationDisplayPanel(Uniquifier); // Create the display panel class if( panel_disp_ptr == NULL ){ // catasrophic failure init_result = INIT_FAILED; int err_code=GetLastError(); comment_string=__FUNCTION__+":...."+ErrorDescription(err_code); Comment(comment_string); Print(comment_string); } } InitializeIndiDrawing(); } class InformationDisplayPanel // This could be defined as a singleton class { private: //======= arrays to hold Panel Object definition and state data ========== static string ... static color ... static int ... static long m_disp_X_pos[]; static long m_disp_Y_pos[]; //===== Class Worker Variables ===== ... double m_EQUITY,m_vol_now,m_vol_rest_buy,m_vol_rest_sell; public: void DisplayPanel(const int& stats_bar, const double& atr_val, const double& atr_up_val, const double& non_lag_MA_val, const double& atr_dn_val){ m_vol_now = money_lots;// } *panel_disp_ptr = NULL;// ========== END DisplayPanel ==========
test 1: k_big_macd_main_color << from other indicator << working here test 2: g_money_max_lots << from money << not test now
output display indicator <<get update variable from Input here test 1 is oorther indicator output buffer , or from other module ou
passdata by indicator input money_lots
custom_indicator_handle1 = iCustom(m_symbol.Name(),m_period,"tailing\\nonLagMA_LB",...,k_big_macd_main_color);
k_big_macd_main_color get update (use debug Check ok)
indicator can't use debug to stop >,<
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I display data indicator_A. And some data calculate from other modual (money_C,ea-signal-indicator_B ).
Want update display panel (define variable in indicator_A) << money_C ,ea-signal-indicator_B
I try use extern double XX, or use iCustom(...,ea-signal-indicator_B). Don't know how to update input variable of iCustom indicator .