.

Re: Coding Help

#1021
Jimmy wrote:
Mon Jul 22, 2019 3:37 pm
aphong wrote:
Mon Jul 22, 2019 1:49 pm
Thanks mrtools! ... I know it could be imposible to have the mq4 file! ... :thumbup:
honestly, Im studying mql4 ... really want to know some great knowledge ... like formulas of some Averaging Methods, or what is a Quadratic Interpolation? is it repainting? or how to create the standard deviation envelops ? ... If you know where there are Public source codes of things like these on FS ... please direct me to right place for studying?

Have a good day All!
Welcome to the site. There's source codes available all over this site. However, if a source code is not provided, please respect the coder's decision to protect his work from theft.

PS: As you are new here, we ask that you read our rules thread first before anything.
Thanks Jimmy :thumbup:


Re: Coding Help

#1022
aphong wrote:
Mon Jul 22, 2019 5:08 pm
Jimmy wrote:
Mon Jul 22, 2019 3:37 pm

Welcome to the site. There's source codes available all over this site. However, if a source code is not provided, please respect the coder's decision to protect his work from theft.

PS: As you are new here, we ask that you read our rules thread first before anything.
Thanks Jimmy :thumbup:
Sure! Also, check out all the latest files in our Moving Average indicators for MT4 thread. We've been uploading lots of Mladen & Mrtools's great codes in MQL4 as standalone indicators that you can use as a starting point for your coding :)
11-year downtrend continues. Myfxbook live results (using Mrtools' indicators).
Need custom MT4 coding? Send a PM to Mrtools or post here for a quote!

Re: Coding Help

#1023
aphong wrote:
Mon Jul 22, 2019 2:15 am
mladen wrote:
Tue Feb 14, 2017 12:03 am
Decided to keep this subject as a section, not as a single thread.

I think that this way we can have cleaner overview and state of coding issues and help (which will, eventually, help more than one single thread will all the issues - harder to find, at the lest then seeing issue short description in the thread name ...)
___________________________

So I would like to suggest it as a kind of a standard :
the thread name should have a short, but descriptive name that describes well enough the codding issue
Hello master mladen & all others,
First, Thank you so much master mladen for sharing lots of cool indis :)
...im quite new to FX & Coding mql4.
I find the "averages - mtf - alerts 9.1.ex4" so cool & want to get signals from this indi by iCustom call.
in fact ... Im testing this by writting an indi to visualize the signals again & check with the signals generated by the "averages - mtf - alerts 9.1.ex4" ... But things are not good, my signals ( yellow & blue arrows) doesnt match the original signals (red & green dots) ? :oops:
is that im calling wrong buffer or sending wrong parameters? please help :(
attached is my code & an image to better describe my problem.


hello, the parameter 13 that you set in the iCustom function corresponds to the one in the picture is right?
Cattura.JPG
The perfect indicatoris our head ...

Too many indicators confuse the head

Re: Coding Help

#1024
pacois wrote:
Mon Jul 22, 2019 7:10 pm
hello, the parameter 13 that you set in the iCustom function corresponds to the one in the picture is right?
Thanks Friend! ... seems like It was my mistake! :D

Re: Coding Help

#1025
Dear Experts and Seniors,

Need your help, please. I have two requests:

a) I am trying to make an expert to place order based on buy and sell confirmation arrows from "gann_t3_high-low_activator_channel_mtf_1.03_nmc". Have attached the indicator and expert. However, I am sure there is some mistake I am making here. I have no coding experience. The expert places orders at its own will and that too before the confirmation arrow.

Please help in fixing the expert to do what it's meant to do.

b) I am using a very simple format of Expert Template.

At the same time, would it be possible to add a condition that the Expert will place only one order during the duration of the respective timeframe candle?

Thanking you in advance for your time and efforts. Much appreciated as always!

Cheers!
gann_t3_high-low_activator_channel_mtf_1.03_nmc.mq4
(10.91 KiB) Downloaded 152 times
GannHiloBuySellExpert.mq4
(9.3 KiB) Downloaded 160 times


Re: Coding Help

#1026
Hi there. Can anyone help me to convert the attached TMMS indicator to MT5 please? It is an indicator with colored histograms for the oscillators RSI & Stochastics (refer to indicator window 2) which is more easy for the eyes than the line version (refer to indicator window 1).

Thanks!
Regards,
Esther

Mod edit: External link removed.
TMMS.PNG
smTMMS Oscillator_v1.0.mq4
(5.72 KiB) Downloaded 159 times

Re: Coding Help

#1027
Hi all pro coders,
Im new to mql
Im trying to code an simple indicator to quickly change chart type between bar charts & candlestick chart when press C key... but something weird happened, my indi seems only work when there is a tick comming, i think it should work right away after I press C key! Dont know what is the problem here? ... one more thing, I notice that when I press C key then the bars/ candlestick icon is changed immediately but the display on main chart is not =))

Could anyone please find BUGs in my simple indi? attached is the codes

thanks & have a good weekend :)

Code: Select all

//------------------------------------------------------------------
#property indicator_chart_window
#define C 67

extern bool indicator_ON = true;

double CHARTTYPE;

int OnInit()
  {
   CHARTTYPE = getCHARTTYPE_glovar();
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   if (reason==REASON_REMOVE) GlobalVariableDel("ChangeChartType"+ Symbol()+string(ChartID()));
  }
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[])
  {
   if (indicator_ON) updateCHARTTYPE(CHARTTYPE);
   return(rates_total);
  }
 ///
void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
  {
   
   if(id == CHARTEVENT_KEYDOWN && lparam == C) 
   {press_C();}
  }
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
//
double getCHARTTYPE_glovar()
{
double result;
//
   if (indicator_ON) 
   {
         if (GlobalVariableCheck("ChangeChartType"+ Symbol()+string(ChartID())))
         {
            if (  (GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID())) == 0)         
               || (GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID())) == 1)  )
            {result = GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID()));} 
         }      
         else
         {  
            result = 1;
            GlobalVariableSet("ChangeChartType"+ Symbol()+string(ChartID()),1);// Creat & set initial value for global variable
         }
   }
return(result);
}
///////
void press_C()
{
double   charttype      = GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID()));
//
              if (indicator_ON)
              {
               if(charttype ==0)
                 {
                  CHARTTYPE = 1;
                  GlobalVariableSet("ChangeChartType"+ Symbol()+string(ChartID()),1);
                  //
                 }
               else if(charttype ==1)
                 {
                  CHARTTYPE = 0;
                  GlobalVariableSet("ChangeChartType"+ Symbol()+string(ChartID()),0);
                  //
                 }
               }
//              
updateCHARTTYPE(CHARTTYPE);                                
}
///////
void updateCHARTTYPE (double ChartType)
{
long     Chart_ID       = ChartID();
//
ChartSetInteger(Chart_ID,CHART_MODE,ChartType);
}

Re: Coding Help

#1028
aphong wrote:
Sun Aug 04, 2019 2:07 pm
Hi all pro coders,
Im new to mql
Im trying to code an simple indicator to quickly change chart type between bar charts & candlestick chart when press C key... but something weird happened, my indi seems only work when there is a tick comming, i think i should work right away after I press C key! Dont know what is the problem here? ... one more thing, I notice that when I press C key then the bars/ candlestick icon is changed immediately but the display on main chart is not =))

Could anyone please find BUGs in my simple indi? attached is the codes

thanks & have a good weekend :)

Code: Select all

//------------------------------------------------------------------
#property indicator_chart_window
#define C 67

extern bool indicator_ON = true;

double CHARTTYPE;

int OnInit()
  {
   CHARTTYPE = getCHARTTYPE_glovar();
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   if (reason==REASON_REMOVE) GlobalVariableDel("ChangeChartType"+ Symbol()+string(ChartID()));
  }
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[])
  {
   if (indicator_ON) updateCHARTTYPE(CHARTTYPE);
   return(rates_total);
  }
 ///
void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
  {
   
   if(id == CHARTEVENT_KEYDOWN && lparam == C) 
   {press_C();}
  }
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
//
double getCHARTTYPE_glovar()
{
double result;
//
   if (indicator_ON) 
   {
         if (GlobalVariableCheck("ChangeChartType"+ Symbol()+string(ChartID())))
         {
            if (  (GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID())) == 0)         
               || (GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID())) == 1)  )
            {result = GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID()));} 
         }      
         else
         {  
            result = 1;
            GlobalVariableSet("ChangeChartType"+ Symbol()+string(ChartID()),1);// Creat & set initial value for global variable
         }
   }
return(result);
}
///////
void press_C()
{
double   charttype      = GlobalVariableGet("ChangeChartType"+ Symbol()+string(ChartID()));
//
              if (indicator_ON)
              {
               if(charttype ==0)
                 {
                  CHARTTYPE = 1;
                  GlobalVariableSet("ChangeChartType"+ Symbol()+string(ChartID()),1);
                  //
                 }
               else if(charttype ==1)
                 {
                  CHARTTYPE = 0;
                  GlobalVariableSet("ChangeChartType"+ Symbol()+string(ChartID()),0);
                  //
                 }
               }
//              
updateCHARTTYPE(CHARTTYPE);                                
}
///////
void updateCHARTTYPE (double ChartType)
{
long     Chart_ID       = ChartID();
//
ChartSetInteger(Chart_ID,CHART_MODE,ChartType);
}
Maybe this code will help with it you can change from bars to candles, with an on chart button.
clean chart 2.mq4
(3.11 KiB) Downloaded 142 times

Re: Coding Help

#1029
mrtools wrote:
Sun Aug 04, 2019 4:49 pm
...
Maybe this code will help with it you can change from bars to candles, with an on chart button.
Great! it works like a charm Master :)) ... but, could you please me know why my code doesnt work ... is that code bug?
have a good weekend Sir! :clap:

Code: Select all

//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//------------------------------------------------------------------
#property indicator_chart_window
#define C 67

extern bool indicator_ON = true;

int OnInit()
  {
   return(INIT_SUCCEEDED);
  }

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(rates_total);
  }
 ///
void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
  {
   if(id == CHARTEVENT_KEYDOWN && lparam == C) 
   {press_C();}
  }
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
//

///////
void press_C()
{
//
  if (indicator_ON)
  {
   updateCHARTTYPE();
  }                              
}
///////
void updateCHARTTYPE ()
{
long     Chart_ID       = ChartID();
//
double CHARTTYPE = ChartGetInteger(Chart_ID,CHART_MODE);
if          (CHARTTYPE !=1) ChartSetInteger(Chart_ID,CHART_MODE,1); 
else if     (CHARTTYPE !=0) ChartSetInteger(Chart_ID,CHART_MODE,0);
}

Re: Coding Help

#1030
Hey! ... aha moment .... Thanks master mrTool !... my indi need one more simple line code of yours : ChartRedraw(0);
;)

Code: Select all

#property indicator_chart_window
#define C 67

extern bool indicator_ON = true;

int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
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(rates_total);
  }
 ///
void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
  {
   if(id == CHARTEVENT_KEYDOWN && lparam == C) 
   {press_C();}
   
  }
///////
void press_C()
{
//
  if (indicator_ON)
  {
   updateCHARTTYPE();
   ChartRedraw(0);
  }                              
}
///////
void updateCHARTTYPE ()
{
long     Chart_ID       = ChartID();
//
double CHARTTYPE = ChartGetInteger(Chart_ID,CHART_MODE);
if          (CHARTTYPE !=1) ChartSetInteger(Chart_ID,CHART_MODE,1); 
else if     (CHARTTYPE !=0) ChartSetInteger(Chart_ID,CHART_MODE,0);
}


  1. Similar Topics

    1. Help coding simple EA

      5 Replies 621 Views

      by Griff90, Tue Nov 13, 2018 8:36 am in Coding Help

      5 Replies
      621 Views
    2. Coding Help : telegram EA notification

      6 Replies 3048 Views

      by redbulls60, Sun Jan 21, 2018 9:45 pm in Coding Help

      6 Replies
      3048 Views

Return to “Coding Help”

Who is online

Users browsing this forum: CommonCrawl [Bot], Google Grapeshot [Bot], Seznam [Bot] and 2 guests