indicator Bar CLOSE % review at chart New comment

 

Hi friends,


Is there any indicator in the market which is free... that shows a Bar close at how many % of the whole body? 

When my mouse point at that bar, it will review at the right top side of the Chart. Very small with number percentage showing in colour Setting.

Red = Bear 
Example 40%

Green = Bull
Example 96%

im using mt4. Thank you for you guys help. 

:)


When your mouse point at this candle (blue arrow) it shows 75% at the right corner, means the bar closed at 75% of the candle. 75% in Blue means Bullish Bar




When your mouse point at this candle (blue arrow) it shows 92% at the right corner, means the bar closed at 92% of the candle. 92% in red means Bearish Bar


When your mouse point at this candle (blue arrow) it shows 90% at the right corner, means the bar closed at 90% of the candle. 90% in red means Bearish Bar

 
Tea-TIme:

Hi friends,

Is there any indicator in the market which is free... 

try search in codebase or implement below code in your indicator.

int candleclose()
{
   double open    = iOpen(_Symbol,PERIOD_CURRENT,1);
   double high    = iHigh(_Symbol,PERIOD_CURRENT,1);
   double low     = iLow(_Symbol,PERIOD_CURRENT,1);
   double close   = iClose(_Symbol,PERIOD_CURRENT,1);

   int range = int ((high-low)/_Point);
   int closerange = 0;
   
   if(open<close) closerange = int ((close-low)/_Point); // Bullish
   else if(open>close) closerange = int ((high-close)/_Point); // Bearish
   
   return (closerange*100)/range;
}
 
Mohamad Zulhairi Baba:

try search in codebase or implement below code in your indicator.

Thank you Zulhairi for your reply ;)

Sorry i am a newbie in code. How can I use your code implement into indicator. :/

 

Use the </>  button to insert your code.


 
Tea-TIme: i am a newbie in code. How can I use your code implement into indicator. :/
  1. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. You have only four choices:
    1. Search for it,
    2. learn to code it. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.
    3. Beg at Coding help - MQL4 and MetaTrader 4 - MQL4 programming forum or Need help with coding - General - MQL5 programming forum or Free MQL4 To MQL5 Converter - General - MQL5 programming forum or Requests & Ideas (MQL5 only!),
    4. or pay (Freelance) someone to code it.
    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
              No free help
              urgent help.

 
whroeder1:
  1. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. You have only four choices:
    1. Search for it,
    2. learn to code it. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.
    3. Beg at Coding help - MQL4 and MetaTrader 4 - MQL4 programming forum or Need help with coding - General - MQL5 programming forum or Free MQL4 To MQL5 Converter - General - MQL5 programming forum or Requests & Ideas (MQL5 only!),
    4. or pay (Freelance) someone to code it.
    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
              No free help
              urgent help.

ok 1st time using this forum. thanks for the tip

 
//+------------------------------------------------------------------+
//|                                                         Bar%.mq4 |
//|                                                             K.fx |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "K.fx"
#property link      ""
#property version   "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int candleclose()
{
   double open    = iOpen(_Symbol,PERIOD_CURRENT,1);
   double high    = iHigh(_Symbol,PERIOD_CURRENT,1);
   double low     = iLow(_Symbol,PERIOD_CURRENT,1);
   double close   = iClose(_Symbol,PERIOD_CURRENT,1);

   int range = int ((high-low)/_Point);
   int closerange = 0;
   
   if(open<close) closerange = int ((close-low)/_Point); // Bullish
   else if(open>close) closerange = int ((high-close)/_Point); // Bearish
   
   return (closerange*100)/range;
}
//+------------------------------------------------------------------+
//| 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);
  }
//+------------------------------------------------------------------+
 
Eleni Anna Branou:

Use the </>  button to insert your code.


Thank you. I have edited it. Sorry for that... I was not used to the forum but definitely is going to adjust to it. ;D

 
  1.             ... const int &spread[]){
       return(rates_total);
      }
    You just posted code that does nothing! Start with making it separate chart, add a buffer, and draw a line. (Find an example in the code base.)

  2. If you want "When your mouse point at this candle" then you will have to implement events which is a hundred times harder than #1.
              Client Terminal Events - MQL4 programs - MQL4 Reference
              Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 6