FerruFx_Trend+_2

FerruFx_Trend+_2

This script is designed to provide a comprehensive overview of market trends by synthesizing data from multiple timeframes and various technical indicators into a single, easy-to-read dashboard. Instead of relying on just one signal, it creates a "consensus" view of whether the market is trending up or down.

How the Logic Works

1. Multi-Timeframe Analysis The script doesn't just look at the chart you are currently viewing. It simultaneously scans several different timeframes (ranging from 1-minute charts to Daily charts). By doing this, it helps identify if a move is just a small flicker on a fast chart or a significant movement supported by higher timeframes.

2. Diverse Indicator Integration To ensure the trend data is well-rounded, the script pulls information from five different types of technical analysis tools:

  • Stochastic Oscillator: Measures price momentum to see if the market is overbought or oversold.
  • RSI (Relative Strength Index): Helps identify the speed and change of price movements.
  • Force Index: Measures the strength of a trend by looking at the volume and price movement together.
  • Momentum: Tracks the rate of change in price over specific periods.
  • DeMarker: A momentum indicator that helps filter out "noise" to see the underlying trend direction.
  • Waddah Attar Explosion (WAE): Analyzes the expansion and contraction of price movements to detect volatility and trend strength.

3. Weighting and Scoring System The core intelligence of the script lies in how it combines these signals:

  • Consensus Scoring: For every timeframe checked, the script looks at the status of each indicator. If an indicator suggests an "Up" trend, it adds to a specific tally; if it suggests "Down," it adds to another.
  • Timeframe Weighting: You can assign different levels of importance (coefficients) to different timeframes. For example, you can choose to give the Daily chart more "weight" than the 1-minute chart, ensuring that long-term trends have a bigger influence on the final result.
  • Trend Strength Calculation: The script calculates a percentage for both upward and downward trends based on these combined scores.

4. Visual Dashboard & Classification The script translates all this complex math into a visual display on your screen, featuring:

  • Status Labels: It clearly displays "UP" or "DOWN" with associated percentages.
  • Strength Categorization: The logic automatically classifies the trend as [Strong] or [Weak].
    • If the upward trend percentage exceeds a specific threshold (e.g., 75%), it labels it as "Strong."
    • If it is above 50% but below that threshold, it identifies it as a "Weak" trend.
  • Color Coding: It uses colors (like Lime for Up and Red for Down) to provide an instant visual cue of the market's current state.

Summary for the User

Essentially, this tool acts like a "committee" of analysts. Each indicator is a different analyst looking at a different timeframe. The script listens to all of them, weights their opinions based on your preferences, and then gives you a final summary: Which way is the market going, and how much confidence can we have in that direction?

Indicators Used
Stochastic oscillatorRelative strength indexForce indexMomentum indicatorDeMarker indicator
Miscellaneous
It issuies visual alerts to the screenIt plays sound alerts
17 Views
0 Downloads
0 Favorites
FerruFx_Trend+_2
//+------------------------------------------------------------------+
//|                                             FerruFx_Trend+_2.mq4 |
//|                                        Copyright © 2007, FerruFx |
//|                                                                  |
//+------------------------------------------------------------------+


#property indicator_separate_window

#property indicator_minimum 0
#property indicator_maximum 1

#property indicator_buffers 2

//---- Level to change the strength "weak" to "strong"
extern double TrendStrongLevel = 75.00;

//---- Calculation of the trend. Let's give high TFs more "force"
extern string    Coefs_high_TF         = "=== SUM must be = 7 ===";
extern double    coef_m1               =      1.0;
extern double    coef_m5               =      1.0;
extern double    coef_m15              =      1.0;
extern double    coef_m30              =      1.0;
extern double    coef_H1               =      1.0;
extern double    coef_H4               =      1.0;
extern double    coef_D1               =      1.0;
// extern double    coef_W1               =      1.0;

// indicators parameters

extern string    Shift_Settings_test_only        = "=== Format: 2007.05.02 00:00 ===";
extern datetime  look_time_shift       = D'2007.05.07 00:00';  // Shift for test if "test" is true
extern double    shift_indicators      =                   0;  // Shift for indicators if "test" is false
extern bool      test                  =               false;

//---- buffers
double TrendUPBuffer[];
double TrendDOWNBuffer[];

string    STOCHASTIC_Settings   = "=== STOCHASTIC Settings ===";
int       STOKPeriod            =            5;  // Stochastic %K  period
int       STODPeriod            =            3;  // Stochastic %D  period
int       STOSlowing            =            3;  // Stochastic slowing

string    RSI_Settings          = "=== RSI Settings ===";
int       RSIPeriod             =           14;  // RSI  period

string    FORCE_Settings        = "=== FORCE INDEX Settings ===";
int       FIPeriod              =           14;  // Force Index period
int       FIMethod              =     MODE_SMA;  // Force Index method
int       FIPrice               =  PRICE_CLOSE;  // Force Index price

string    MOMENTUM_Settings     = "=== MOMENTUM INDEX Settings ===";
int       MOMPeriod             =           14;  // Momentum period
int       MOMPrice              =  PRICE_CLOSE;  // Momentum price

string    DeMARKER_Settings     = "=== DeMARKER Settings ===";
int       DEMPeriod             =           14;  // DeMarker  period



double UP_65, UP_66, UP_67, UP_68, UP_69, UP_70;
double UP_71, UP_72, UP_73, UP_74, UP_75, UP_76, UP_77, UP_78, UP_79, UP_80;
double UP_81, UP_82, UP_83, UP_84, UP_85, UP_86, UP_87, UP_88, UP_89, UP_90;
double UP_91, UP_92, UP_93, UP_94, UP_95, UP_96, UP_97, UP_98, UP_99, UP_100;
double UP_101, UP_102, UP_103, UP_104, UP_105, UP_106, UP_107, UP_108, UP_109, UP_110;
double UP_111, UP_112;

double DOWN_65, DOWN_66, DOWN_67, DOWN_68, DOWN_69, DOWN_70;
double DOWN_71, DOWN_72, DOWN_73, DOWN_74, DOWN_75, DOWN_76, DOWN_77, DOWN_78, DOWN_79, DOWN_80;
double DOWN_81, DOWN_82, DOWN_83, DOWN_84, DOWN_85, DOWN_86, DOWN_87, DOWN_88, DOWN_89, DOWN_90;
double DOWN_91, DOWN_92, DOWN_93, DOWN_94, DOWN_95, DOWN_96, DOWN_97, DOWN_98, DOWN_99, DOWN_100;
double DOWN_101, DOWN_102, DOWN_103, DOWN_104, DOWN_105, DOWN_106, DOWN_107, DOWN_108, DOWN_109, DOWN_110;
double DOWN_111, DOWN_112;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- name for indicator window

   string short_name=" ";
   IndicatorShortName(short_name);
   
   SetIndexBuffer(0,TrendUPBuffer);
   SetIndexBuffer(1,TrendDOWNBuffer);
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double coef = coef_m1 + coef_m5 + coef_m15 + coef_m30 + coef_H1 + coef_H4 + coef_D1;
   if( coef != 7 ) { Alert("The sum of the coefs must be 7. Your setting is ", coef,"!!!"); }
  
   color color_common_line = White;
   color color_common_text = White;
   color color_ind = PowderBlue;
   color color_indic;
   color color_pivots_1=PaleVioletRed;
   double x;
   
// Shift calculation for indicators (tests only)

   double shift_1, shift_5, shift_15, shift_30, shift_60, shift_240, shift_1440, shift_10080;
   
   if( test == true )
   {
    shift_1=iBarShift(NULL,PERIOD_M1,look_time_shift,false);
    shift_5=iBarShift(NULL,PERIOD_M5,look_time_shift,false);
    shift_15=iBarShift(NULL,PERIOD_M15,look_time_shift,false);
    shift_30=iBarShift(NULL,PERIOD_M30,look_time_shift,false);
    shift_60=iBarShift(NULL,PERIOD_H1,look_time_shift,false);
    shift_240=iBarShift(NULL,PERIOD_H4,look_time_shift,false);
    shift_1440=iBarShift(NULL,PERIOD_D1,look_time_shift,false);
    shift_10080=iBarShift(NULL,PERIOD_W1,look_time_shift,false);
   }
   else
   {
    shift_1=shift_indicators;
    shift_5=shift_indicators;
    shift_15=shift_indicators;
    shift_30=shift_indicators;
    shift_60=shift_indicators;
    shift_240=shift_indicators;
    shift_1440=shift_indicators;
    shift_10080=shift_indicators;
  }
   
//---- calculation for the label's X/Y

   int add_x, add_y;
   
    add_x = -160;
    add_y = 25;
      
// Indicator (STOCH)

   ObjectCreate("stoch", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("stoch","STOCH",9, "Verdana", color_ind);
   ObjectSet("stoch", OBJPROP_CORNER, 0);
   ObjectSet("stoch", OBJPROP_XDISTANCE, 601+add_x);
   ObjectSet("stoch", OBJPROP_YDISTANCE, -5+add_y);
   
   string STOCH_Trend_1, STOCH_Trend_5, STOCH_Trend_15, STOCH_Trend_30, STOCH_Trend_60, STOCH_Trend_240, STOCH_Trend_1440, STOCH_Trend_10080;
   
   double stoch_m_1=iStochastic(NULL,PERIOD_M1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_1);
   double stoch_s_1=iStochastic(NULL,PERIOD_M1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_1);

   if (stoch_m_1 >= stoch_s_1) { STOCH_Trend_1 = "UP"; x = 616; color_indic = Lime; UP_65 = 1; DOWN_65 = 0; }
   if (stoch_m_1 < stoch_s_1) { STOCH_Trend_1 = "DOWN"; x = 606; color_indic = Red; UP_65 = 0; DOWN_65 = 1; }
   ObjectCreate("Trend_STOCH_1", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_1",STOCH_Trend_1,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_1", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_1", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_1", OBJPROP_YDISTANCE, 22+add_y);
   
   double stoch_m_5=iStochastic(NULL,PERIOD_M5,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_5);
   double stoch_s_5=iStochastic(NULL,PERIOD_M5,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_5);

   if (stoch_m_5 >= stoch_s_5) { STOCH_Trend_5 = "UP"; x = 616; color_indic = Lime; UP_66 = 1; DOWN_66 = 0; }
   if (stoch_m_5 < stoch_s_5) { STOCH_Trend_5 = "DOWN"; x = 606; color_indic = Red; UP_66 = 0; DOWN_66 = 1; }
   ObjectCreate("Trend_STOCH_5", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_5",STOCH_Trend_5,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_5", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_5", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_5", OBJPROP_YDISTANCE, 37+add_y);
   
   double stoch_m_15=iStochastic(NULL,PERIOD_M15,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_15);
   double stoch_s_15=iStochastic(NULL,PERIOD_M15,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_15);

   if (stoch_m_15 >= stoch_s_15) { STOCH_Trend_15 = "UP"; x = 616; color_indic = Lime; UP_67 = 1; DOWN_67 = 0; }
   if (stoch_m_15 < stoch_s_15) { STOCH_Trend_15 = "DOWN"; x = 606; color_indic = Red; UP_67 = 0; DOWN_67 = 1; }
   ObjectCreate("Trend_STOCH_15", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_15",STOCH_Trend_15,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_15", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_15", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_15", OBJPROP_YDISTANCE, 52+add_y);
   
   double stoch_m_30=iStochastic(NULL,PERIOD_M30,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_30);
   double stoch_s_30=iStochastic(NULL,PERIOD_M30,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_30);

   if (stoch_m_30 >= stoch_s_30) { STOCH_Trend_30 = "UP"; x = 616; color_indic = Lime; UP_68 = 1; DOWN_68 = 0; }
   if (stoch_m_30 < stoch_s_30) { STOCH_Trend_30 = "DOWN"; x = 606; color_indic = Red; UP_68 = 0; DOWN_68 = 1; }
   ObjectCreate("Trend_STOCH_30", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_30",STOCH_Trend_30,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_30", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_30", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_30", OBJPROP_YDISTANCE, 67+add_y);
   
   double stoch_m_60=iStochastic(NULL,PERIOD_H1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_60);
   double stoch_s_60=iStochastic(NULL,PERIOD_H1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_60);

   if (stoch_m_60 >= stoch_s_60) { STOCH_Trend_60 = "UP"; x = 616; color_indic = Lime; UP_69 = 1; DOWN_69 = 0; }
   if (stoch_m_60 < stoch_s_60) { STOCH_Trend_60 = "DOWN"; x = 606; color_indic = Red; UP_69 = 0; DOWN_69 = 1; }
   ObjectCreate("Trend_STOCH_60", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_60",STOCH_Trend_60,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_60", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_60", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_60", OBJPROP_YDISTANCE, 82+add_y);
   
   double stoch_m_240=iStochastic(NULL,PERIOD_H4,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_240);
   double stoch_s_240=iStochastic(NULL,PERIOD_H4,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_240);

   if (stoch_m_240 >= stoch_s_240) { STOCH_Trend_240 = "UP"; x = 616; color_indic = Lime; UP_70 = 1; DOWN_70 = 0; }
   if (stoch_m_240 < stoch_s_240) { STOCH_Trend_240 = "DOWN"; x = 606; color_indic = Red; UP_70 = 0; DOWN_70 = 1; }
   ObjectCreate("Trend_STOCH_240", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_240",STOCH_Trend_240,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_240", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_240", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_240", OBJPROP_YDISTANCE, 97+add_y);
   
   double stoch_m_1440=iStochastic(NULL,PERIOD_D1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_1440);
   double stoch_s_1440=iStochastic(NULL,PERIOD_D1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_1440);

   if (stoch_m_1440 >= stoch_s_1440) { STOCH_Trend_1440 = "UP"; x = 616; color_indic = Lime; UP_71 = 1; DOWN_71 = 0; }
   if (stoch_m_1440 < stoch_s_1440) { STOCH_Trend_1440 = "DOWN"; x = 606; color_indic = Red; UP_71 = 0; DOWN_71 = 1; }
   ObjectCreate("Trend_STOCH_1440", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_1440",STOCH_Trend_1440,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_1440", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_1440", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_1440", OBJPROP_YDISTANCE, 112+add_y);
   
   /*
   double stoch_m_10080=iStochastic(NULL,PERIOD_W1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_MAIN,shift_10080);
   double stoch_s_10080=iStochastic(NULL,PERIOD_W1,STOKPeriod,STODPeriod,STOSlowing,MODE_SMA,1,MODE_SIGNAL,shift_10080);

   if (stoch_m_10080 >= stoch_s_10080) { STOCH_Trend_10080 = "UP"; x = 616; color_indic = Lime; UP_72 = 1; DOWN_72 = 0; }
   if (stoch_m_10080 < stoch_s_10080) { STOCH_Trend_10080 = "DOWN"; x = 606; color_indic = Red; UP_72 = 0; DOWN_72 = 1; }
   ObjectCreate("Trend_STOCH_10080", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_STOCH_10080",STOCH_Trend_10080,7, "Verdana", color_indic);
   ObjectSet("Trend_STOCH_10080", OBJPROP_CORNER, 0);
   ObjectSet("Trend_STOCH_10080", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_STOCH_10080", OBJPROP_YDISTANCE, 127+add_y);
   */
   
// Indicator (RSI)

   ObjectCreate("rsi", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("rsi","RSI",9, "Verdana", color_ind);
   ObjectSet("rsi", OBJPROP_CORNER, 0);
   ObjectSet("rsi", OBJPROP_XDISTANCE, 662+add_x);
   ObjectSet("rsi", OBJPROP_YDISTANCE, -5+add_y);
   
   string RSI_Trend_1, RSI_Trend_5, RSI_Trend_15, RSI_Trend_30, RSI_Trend_60, RSI_Trend_240, RSI_Trend_1440, RSI_Trend_10080;
   
   double rsi_1=iRSI(NULL,PERIOD_M1,RSIPeriod,PRICE_CLOSE,shift_1);
   
   if (rsi_1 >= 50) { RSI_Trend_1 = "UP"; x = 666; color_indic = Lime; UP_73 = 1; DOWN_73 = 0; }
   if (rsi_1 < 50) { RSI_Trend_1 = "DOWN"; x = 656; color_indic = Red; UP_73 = 0; DOWN_73 = 1; }
   ObjectCreate("Trend_RSI_1", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_1",RSI_Trend_1,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_1", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_1", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_1", OBJPROP_YDISTANCE, 22+add_y);
   
   double rsi_5=iRSI(NULL,PERIOD_M5,RSIPeriod,PRICE_CLOSE,shift_5);
   
   if (rsi_5 >= 50) { RSI_Trend_5 = "UP"; x = 666; color_indic = Lime; UP_74 = 1; DOWN_74 = 0; }
   if (rsi_5 < 50) { RSI_Trend_5 = "DOWN"; x = 656; color_indic = Red; UP_74 = 0; DOWN_74 = 1; }
   ObjectCreate("Trend_RSI_5", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_5",RSI_Trend_5,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_5", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_5", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_5", OBJPROP_YDISTANCE, 37+add_y);
   
   double rsi_15=iRSI(NULL,PERIOD_M15,RSIPeriod,PRICE_CLOSE,shift_15);
   
   if (rsi_15 >= 50) { RSI_Trend_15 = "UP"; x = 666; color_indic = Lime; UP_75 = 1; DOWN_75 = 0; }
   if (rsi_15 < 50) { RSI_Trend_15 = "DOWN"; x = 656; color_indic = Red; UP_75 = 0; DOWN_75 = 1; }
   ObjectCreate("Trend_RSI_15", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_15",RSI_Trend_15,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_15", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_15", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_15", OBJPROP_YDISTANCE, 52+add_y);
   
   double rsi_30=iRSI(NULL,PERIOD_M30,RSIPeriod,PRICE_CLOSE,shift_30);
   
   if (rsi_30 >= 50) { RSI_Trend_30 = "UP"; x = 666; color_indic = Lime; UP_76 = 1; DOWN_76 = 0; }
   if (rsi_30 < 50) { RSI_Trend_30 = "DOWN"; x = 656; color_indic = Red; UP_76 = 0; DOWN_76 = 1; }
   ObjectCreate("Trend_RSI_30", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_30",RSI_Trend_30,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_30", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_30", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_30", OBJPROP_YDISTANCE, 67+add_y);
   
   double rsi_60=iRSI(NULL,PERIOD_H1,RSIPeriod,PRICE_CLOSE,shift_60);
   
   if (rsi_60 >= 50) { RSI_Trend_60 = "UP"; x = 666; color_indic = Lime; UP_77 = 1; DOWN_77 = 0; }
   if (rsi_60 < 50) { RSI_Trend_60 = "DOWN"; x = 656; color_indic = Red; UP_77 = 0; DOWN_77 = 1; }
   ObjectCreate("Trend_RSI_60", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_60",RSI_Trend_60,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_60", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_60", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_60", OBJPROP_YDISTANCE, 82+add_y);
   
   double rsi_240=iRSI(NULL,PERIOD_H4,RSIPeriod,PRICE_CLOSE,shift_240);
   
   if (rsi_240 >= 50) { RSI_Trend_240 = "UP"; x = 666; color_indic = Lime; UP_78 = 1; DOWN_78 = 0; }
   if (rsi_240 < 50) { RSI_Trend_240 = "DOWN"; x = 656; color_indic = Red; UP_78 = 0; DOWN_78 = 1; }
   ObjectCreate("Trend_RSI_240", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_240",RSI_Trend_240,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_240", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_240", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_240", OBJPROP_YDISTANCE, 97+add_y);
   
   double rsi_1440=iRSI(NULL,PERIOD_D1,RSIPeriod,PRICE_CLOSE,shift_1440);
   
   if (rsi_1440 >= 50) { RSI_Trend_1440 = "UP"; x = 666; color_indic = Lime; UP_79 = 1; DOWN_79 = 0; }
   if (rsi_1440 < 50) { RSI_Trend_1440 = "DOWN"; x = 656; color_indic = Red; UP_79 = 0; DOWN_79 = 1; }
   ObjectCreate("Trend_RSI_1440", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_1440",RSI_Trend_1440,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_1440", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_1440", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_1440", OBJPROP_YDISTANCE, 112+add_y);
   
   /*
   double rsi_10080=iRSI(NULL,PERIOD_W1,RSIPeriod,PRICE_CLOSE,shift_10080);
   
   if (rsi_10080 >= 50) { RSI_Trend_10080 = "UP"; x = 666; color_indic = Lime; UP_80 = 1; DOWN_80 = 0; }
   if (rsi_10080 < 50) { RSI_Trend_10080 = "DOWN"; x = 656; color_indic = Red; UP_80 = 0; DOWN_80 = 1; }
   ObjectCreate("Trend_RSI_10080", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_RSI_10080",RSI_Trend_10080,7, "Verdana", color_indic);
   ObjectSet("Trend_RSI_10080", OBJPROP_CORNER, 0);
   ObjectSet("Trend_RSI_10080", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_RSI_10080", OBJPROP_YDISTANCE, 127+add_y);
   */
   
// Indicator (FORCE INDEX)

   ObjectCreate("force", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("force","FORCE",9, "Verdana", color_ind);
   ObjectSet("force", OBJPROP_CORNER, 0);
   ObjectSet("force", OBJPROP_XDISTANCE, 701+add_x);
   ObjectSet("force", OBJPROP_YDISTANCE, -5+add_y);
   
   string FI_Trend_1, FI_Trend_5, FI_Trend_15, FI_Trend_30, FI_Trend_60, FI_Trend_240, FI_Trend_1440, FI_Trend_10080;
   
   double fi_1=iForce(NULL,PERIOD_M1,FIPeriod,FIMethod,FIPrice,shift_1);
   
   if (fi_1 >= 0) { FI_Trend_1 = "UP"; x = 716; color_indic = Lime; UP_81 = 1; DOWN_81 = 0; }
   if (fi_1 < 0) { FI_Trend_1 = "DOWN"; x = 706; color_indic = Red; UP_81 = 0; DOWN_81 = 1; }
   ObjectCreate("Trend_FI_1", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_1",FI_Trend_1,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_1", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_1", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_1", OBJPROP_YDISTANCE, 22+add_y);
   
   double fi_5=iForce(NULL,PERIOD_M5,FIPeriod,FIMethod,FIPrice,shift_5);
   
   if (fi_5 >= 0) { FI_Trend_5 = "UP"; x = 716; color_indic = Lime; UP_82 = 1; DOWN_82 = 0; }
   if (fi_5 < 0) { FI_Trend_5 = "DOWN"; x = 706; color_indic = Red; UP_82 = 0; DOWN_82 = 1; }
   ObjectCreate("Trend_FI_5", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_5",FI_Trend_5,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_5", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_5", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_5", OBJPROP_YDISTANCE, 37+add_y);
   
   double fi_15=iForce(NULL,PERIOD_M15,FIPeriod,FIMethod,FIPrice,shift_15);
   
   if (fi_15 >= 0) { FI_Trend_15 = "UP"; x = 716; color_indic = Lime; UP_83 = 1; DOWN_83 = 0; }
   if (fi_15 < 0) { FI_Trend_15 = "DOWN"; x = 706; color_indic = Red; UP_83 = 0; DOWN_83 = 1; }
   ObjectCreate("Trend_FI_15", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_15",FI_Trend_15,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_15", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_15", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_15", OBJPROP_YDISTANCE, 52+add_y);
   
   double fi_30=iForce(NULL,PERIOD_M30,FIPeriod,FIMethod,FIPrice,shift_30);
   
   if (fi_30 >= 0) { FI_Trend_30 = "UP"; x = 716; color_indic = Lime; UP_84 = 1; DOWN_84 = 0; }
   if (fi_30 < 0) { FI_Trend_30 = "DOWN"; x = 706; color_indic = Red; UP_84 = 0; DOWN_84 = 1; }
   ObjectCreate("Trend_FI_30", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_30",FI_Trend_30,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_30", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_30", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_30", OBJPROP_YDISTANCE, 67+add_y);
   
   double fi_60=iForce(NULL,PERIOD_H1,FIPeriod,FIMethod,FIPrice,shift_60);
   
   if (fi_60 >= 0) { FI_Trend_60 = "UP"; x = 716; color_indic = Lime; UP_85 = 1; DOWN_85 = 0; }
   if (fi_60 < 0) { FI_Trend_60 = "DOWN"; x = 706; color_indic = Red; UP_85 = 0; DOWN_85 = 1; }
   ObjectCreate("Trend_FI_60", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_60",FI_Trend_60,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_60", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_60", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_60", OBJPROP_YDISTANCE, 82+add_y);
   
   double fi_240=iForce(NULL,PERIOD_H4,FIPeriod,FIMethod,FIPrice,shift_240);
   
   if (fi_240 >= 0) { FI_Trend_240 = "UP"; x = 716; color_indic = Lime; UP_86 = 1; DOWN_86 = 0; }
   if (fi_240 < 0) { FI_Trend_240 = "DOWN"; x = 706; color_indic = Red; UP_86 = 0; DOWN_86 = 1; }
   ObjectCreate("Trend_FI_240", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_240",FI_Trend_240,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_240", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_240", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_240", OBJPROP_YDISTANCE, 97+add_y);
   
   double fi_1440=iForce(NULL,PERIOD_D1,FIPeriod,FIMethod,FIPrice,shift_1440);
   
   if (fi_1440 >= 0) { FI_Trend_1440 = "UP"; x = 716; color_indic = Lime; UP_87 = 1; DOWN_87 = 0; }
   if (fi_1440 < 0) { FI_Trend_1440 = "DOWN"; x = 706; color_indic = Red; UP_87 = 0; DOWN_87 = 1; }
   ObjectCreate("Trend_FI_1440", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_1440",FI_Trend_1440,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_1440", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_1440", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_1440", OBJPROP_YDISTANCE, 112+add_y);
   
   /*
   double fi_10080=iForce(NULL,PERIOD_W1,FIPeriod,FIMethod,FIPrice,shift_10080);
   
   if (fi_10080 >= 0) { FI_Trend_10080 = "UP"; x = 716; color_indic = Lime; UP_88 = 1; DOWN_88 = 0; }
   if (fi_10080 < 0) { FI_Trend_10080 = "DOWN"; x = 706; color_indic = Red; UP_88 = 0; DOWN_88 = 1; }
   ObjectCreate("Trend_FI_10080", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_FI_10080",FI_Trend_10080,7, "Verdana", color_indic);
   ObjectSet("Trend_FI_10080", OBJPROP_CORNER, 0);
   ObjectSet("Trend_FI_10080", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_FI_10080", OBJPROP_YDISTANCE, 127+add_y);
   */
   
// Indicator (MOMENTUM)

   ObjectCreate("momentum", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("momentum","MOM",9, "Verdana", color_ind);
   ObjectSet("momentum", OBJPROP_CORNER, 0);
   ObjectSet("momentum", OBJPROP_XDISTANCE, 758+add_x);
   ObjectSet("momentum", OBJPROP_YDISTANCE, -5+add_y);
   
   string MOM_Trend_1, MOM_Trend_5, MOM_Trend_15, MOM_Trend_30, MOM_Trend_60, MOM_Trend_240, MOM_Trend_1440, MOM_Trend_10080;
   
   double momentum_1=iMomentum(NULL,PERIOD_M1,MOMPeriod,MOMPrice,shift_1);
   
   if (momentum_1 >= 100) { MOM_Trend_1 = "UP"; x = 766; color_indic = Lime; UP_89 = 1; DOWN_89 = 0; }
   if (momentum_1 < 100) { MOM_Trend_1 = "DOWN"; x = 756; color_indic = Red; UP_89 = 0; DOWN_89 = 1; }
   ObjectCreate("Trend_MOM_1", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_1",MOM_Trend_1,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_1", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_1", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_1", OBJPROP_YDISTANCE, 22+add_y);
   
   double momentum_5=iMomentum(NULL,PERIOD_M5,MOMPeriod,MOMPrice,shift_5);
   
   if (momentum_5 >= 100) { MOM_Trend_5 = "UP"; x = 766; color_indic = Lime; UP_90 = 1; DOWN_90 = 0; }
   if (momentum_5 < 100) { MOM_Trend_5 = "DOWN"; x = 756; color_indic = Red; UP_90 = 0; DOWN_90 = 1; }
   ObjectCreate("Trend_MOM_5", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_5",MOM_Trend_5,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_5", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_5", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_5", OBJPROP_YDISTANCE, 37+add_y);
   
   double momentum_15=iMomentum(NULL,PERIOD_M15,MOMPeriod,MOMPrice,shift_15);
   
   if (momentum_15 >= 100) { MOM_Trend_15 = "UP"; x = 766; color_indic = Lime; UP_91 = 1; DOWN_91 = 0; }
   if (momentum_15 < 100) { MOM_Trend_15 = "DOWN"; x = 756; color_indic = Red; UP_91 = 0; DOWN_91 = 1; }
   ObjectCreate("Trend_MOM_15", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_15",MOM_Trend_15,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_15", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_15", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_15", OBJPROP_YDISTANCE, 52+add_y);
   
   double momentum_30=iMomentum(NULL,PERIOD_M30,MOMPeriod,MOMPrice,shift_30);
   
   if (momentum_30 >= 100) { MOM_Trend_30 = "UP"; x = 766; color_indic = Lime; UP_92 = 1; DOWN_92 = 0; }
   if (momentum_30 < 100) { MOM_Trend_30 = "DOWN"; x = 756; color_indic = Red; UP_92 = 0; DOWN_92 = 1; }
   ObjectCreate("Trend_MOM_30", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_30",MOM_Trend_30,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_30", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_30", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_30", OBJPROP_YDISTANCE, 67+add_y);
   
   double momentum_60=iMomentum(NULL,PERIOD_H1,MOMPeriod,MOMPrice,shift_60);
   
   if (momentum_60 >= 100) { MOM_Trend_60 = "UP"; x = 766; color_indic = Lime; UP_93 = 1; DOWN_93 = 0; }
   if (momentum_60 < 100) { MOM_Trend_60 = "DOWN"; x = 756; color_indic = Red; UP_93 = 0; DOWN_93 = 1; }
   ObjectCreate("Trend_MOM_60", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_60",MOM_Trend_60,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_60", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_60", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_60", OBJPROP_YDISTANCE, 82+add_y);
   
   double momentum_240=iMomentum(NULL,PERIOD_H4,MOMPeriod,MOMPrice,shift_240);
   
   if (momentum_240 >= 100) { MOM_Trend_240 = "UP"; x = 766; color_indic = Lime; UP_94 = 1; DOWN_94 = 0; }
   if (momentum_240 < 100) { MOM_Trend_240 = "DOWN"; x = 756; color_indic = Red; UP_94 = 0; DOWN_94 = 1; }
   ObjectCreate("Trend_MOM_240", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_240",MOM_Trend_240,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_240", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_240", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_240", OBJPROP_YDISTANCE, 97+add_y);
   
   double momentum_1440=iMomentum(NULL,PERIOD_D1,MOMPeriod,MOMPrice,shift_1440);
   
   if (momentum_1440 >= 100) { MOM_Trend_1440 = "UP"; x = 766; color_indic = Lime; UP_95 = 1; DOWN_95 = 0; }
   if (momentum_1440 < 100) { MOM_Trend_1440 = "DOWN"; x = 756; color_indic = Red; UP_95 = 0; DOWN_95 = 1; }
   ObjectCreate("Trend_MOM_1440", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_1440",MOM_Trend_1440,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_1440", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_1440", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_1440", OBJPROP_YDISTANCE, 112+add_y);
   
   /*
   double momentum_10080=iMomentum(NULL,PERIOD_W1,MOMPeriod,MOMPrice,shift_10080);
   
   if (momentum_10080 >= 100) { MOM_Trend_10080 = "UP"; x = 766; color_indic = Lime; UP_96 = 1; DOWN_96 = 0; }
   if (momentum_10080 < 100) { MOM_Trend_10080 = "DOWN"; x = 756; color_indic = Red; UP_96 = 0; DOWN_96 = 1; }
   ObjectCreate("Trend_MOM_10080", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_MOM_10080",MOM_Trend_10080,7, "Verdana", color_indic);
   ObjectSet("Trend_MOM_10080", OBJPROP_CORNER, 0);
   ObjectSet("Trend_MOM_10080", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_MOM_10080", OBJPROP_YDISTANCE, 127+add_y);
   */
   
// Indicator (DE MARKER)

   ObjectCreate("demarker", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("demarker","DeM",9, "Verdana", color_ind);
   ObjectSet("demarker", OBJPROP_CORNER, 0);
   ObjectSet("demarker", OBJPROP_XDISTANCE, 808+add_x);
   ObjectSet("demarker", OBJPROP_YDISTANCE, -5+add_y);
   
   string DEM_Trend_1, DEM_Trend_5, DEM_Trend_15, DEM_Trend_30, DEM_Trend_60, DEM_Trend_240, DEM_Trend_1440, DEM_Trend_10080;

   double demarker_1_0=iDeMarker(NULL,PERIOD_M1,DEMPeriod,shift_1);
   double demarker_1_1=iDeMarker(NULL,PERIOD_M1,DEMPeriod,shift_1+1);
   
   if (demarker_1_0 >= demarker_1_1) { DEM_Trend_1 = "UP"; x = 816; color_indic = Lime; UP_97 = 1; DOWN_97 = 0; }
   if (demarker_1_0 < demarker_1_1) { DEM_Trend_1 = "DOWN"; x = 806; color_indic = Red; UP_97 = 0; DOWN_97 = 1; }
   ObjectCreate("Trend_DEM_1", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_1",DEM_Trend_1,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_1", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_1", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_1", OBJPROP_YDISTANCE, 22+add_y);
   
   double demarker_5_0=iDeMarker(NULL,PERIOD_M5,DEMPeriod,shift_5);
   double demarker_5_1=iDeMarker(NULL,PERIOD_M5,DEMPeriod,shift_5+1);
   
   if (demarker_5_0 >= demarker_5_1) { DEM_Trend_5 = "UP"; x = 816; color_indic = Lime; UP_98 = 1; DOWN_98 = 0; }
   if (demarker_5_0 < demarker_5_1) { DEM_Trend_5 = "DOWN"; x = 806; color_indic = Red; UP_98 = 0; DOWN_98 = 1; }
   ObjectCreate("Trend_DEM_5", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_5",DEM_Trend_5,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_5", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_5", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_5", OBJPROP_YDISTANCE, 37+add_y);
   
   double demarker_15_0=iDeMarker(NULL,PERIOD_M15,DEMPeriod,shift_15);
   double demarker_15_1=iDeMarker(NULL,PERIOD_M15,DEMPeriod,shift_15+1);
   
   if (demarker_15_0 >= demarker_15_1) { DEM_Trend_15 = "UP"; x = 816; color_indic = Lime; UP_99 = 1; DOWN_99 = 0; }
   if (demarker_15_0 < demarker_15_1) { DEM_Trend_15 = "DOWN"; x = 806; color_indic = Red; UP_99 = 0; DOWN_99 = 1; }
   ObjectCreate("Trend_DEM_15", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_15",DEM_Trend_15,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_15", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_15", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_15", OBJPROP_YDISTANCE, 52+add_y);
   
   double demarker_30_0=iDeMarker(NULL,PERIOD_M30,DEMPeriod,shift_30);
   double demarker_30_1=iDeMarker(NULL,PERIOD_M30,DEMPeriod,shift_30+1);
   
   if (demarker_30_0 >= demarker_30_1) { DEM_Trend_30 = "UP"; x = 816; color_indic = Lime; UP_100 = 1; DOWN_100 = 0; }
   if (demarker_30_0 < demarker_30_1) { DEM_Trend_30 = "DOWN"; x = 806; color_indic = Red; UP_100 = 0; DOWN_100 = 1; }
   ObjectCreate("Trend_DEM_30", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_30",DEM_Trend_30,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_30", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_30", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_30", OBJPROP_YDISTANCE, 67+add_y);
   
   double demarker_60_0=iDeMarker(NULL,PERIOD_H1,DEMPeriod,shift_60);
   double demarker_60_1=iDeMarker(NULL,PERIOD_H1,DEMPeriod,shift_60+1);
   
   if (demarker_60_0 >= demarker_60_1) { DEM_Trend_60 = "UP"; x = 816; color_indic = Lime; UP_101 = 1; DOWN_101 = 0; }
   if (demarker_60_0 < demarker_60_1) { DEM_Trend_60 = "DOWN"; x = 806; color_indic = Red; UP_101 = 0; DOWN_101 = 1; }
   ObjectCreate("Trend_DEM_60", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_60",DEM_Trend_60,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_60", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_60", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_60", OBJPROP_YDISTANCE, 82+add_y);
   
   double demarker_240_0=iDeMarker(NULL,PERIOD_H4,DEMPeriod,shift_240);
   double demarker_240_1=iDeMarker(NULL,PERIOD_H4,DEMPeriod,shift_240+1);
   
   if (demarker_240_0 >= demarker_240_1) { DEM_Trend_240 = "UP"; x = 816; color_indic = Lime; UP_102 = 1; DOWN_102 = 0; }
   if (demarker_240_0 < demarker_240_1) { DEM_Trend_240 = "DOWN"; x = 806; color_indic = Red; UP_102 = 0; DOWN_102 = 1; }
   ObjectCreate("Trend_DEM_240", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_240",DEM_Trend_240,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_240", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_240", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_240", OBJPROP_YDISTANCE, 97+add_y);
   
   double demarker_1440_0=iDeMarker(NULL,PERIOD_D1,DEMPeriod,shift_1440);
   double demarker_1440_1=iDeMarker(NULL,PERIOD_D1,DEMPeriod,shift_1440+1);
   
   if (demarker_1440_0 >= demarker_1440_1) { DEM_Trend_1440 = "UP"; x = 816; color_indic = Lime; UP_103 = 1; DOWN_103 = 0; }
   if (demarker_1440_0 < demarker_1440_1) { DEM_Trend_1440 = "DOWN"; x = 806; color_indic = Red; UP_103 = 0; DOWN_103 = 1; }
   ObjectCreate("Trend_DEM_1440", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_1440",DEM_Trend_1440,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_1440", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_1440", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_1440", OBJPROP_YDISTANCE, 112+add_y);
   
   /*
   double demarker_10080_0=iDeMarker(NULL,PERIOD_W1,DEMPeriod,shift_10080);
   double demarker_10080_1=iDeMarker(NULL,PERIOD_W1,DEMPeriod,shift_10080+1);
   
   if (demarker_10080_0 >= demarker_10080_1) { DEM_Trend_10080 = "UP"; x = 816; color_indic = Lime; UP_104 = 1; DOWN_104 = 0; }
   if (demarker_10080_0 < demarker_10080_1) { DEM_Trend_10080 = "DOWN"; x = 806; color_indic = Red; UP_104 = 0; DOWN_104 = 1; }
   ObjectCreate("Trend_DEM_10080", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DEM_10080",DEM_Trend_10080,7, "Verdana", color_indic);
   ObjectSet("Trend_DEM_10080", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DEM_10080", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_DEM_10080", OBJPROP_YDISTANCE, 127+add_y);
   */
   
// Indicator (Waddah Attar Explosion)

   ObjectCreate("wae", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("wae","WAE",9, "Verdana", color_ind);
   ObjectSet("wae", OBJPROP_CORNER, 0);
   ObjectSet("wae", OBJPROP_XDISTANCE, 858+add_x);
   ObjectSet("wae", OBJPROP_YDISTANCE, -5+add_y);
   
   string WAE_Trend_1, WAE_Trend_5, WAE_Trend_15, WAE_Trend_30, WAE_Trend_60, WAE_Trend_240, WAE_Trend_1440, WAE_Trend_10080;
   
   double wae_histo_up_1_0 = iCustom(NULL,PERIOD_M1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_1);
   double wae_histo_up_1_1 = iCustom(NULL,PERIOD_M1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_1+1);
   double wae_histo_down_1_0 = iCustom(NULL,PERIOD_M1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_1);
   double wae_histo_down_1_1 = iCustom(NULL,PERIOD_M1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_1+1);
   
   if (wae_histo_up_1_0 > wae_histo_up_1_1 || wae_histo_down_1_0 < wae_histo_down_1_1) { WAE_Trend_1 = "UP"; x = 866; color_indic = Lime; UP_105 = 1; DOWN_105 = 0; }
   if (wae_histo_up_1_0 < wae_histo_up_1_1 || wae_histo_down_1_0 > wae_histo_down_1_1) { WAE_Trend_1 = "DOWN"; x = 856; color_indic = Red; UP_105 = 0; DOWN_105 = 1; }
   ObjectCreate("Trend_WAE_1", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_1",WAE_Trend_1,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_1", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_1", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_1", OBJPROP_YDISTANCE, 22+add_y);
   
   double wae_histo_up_5_0 = iCustom(NULL,PERIOD_M5,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_5);
   double wae_histo_up_5_1 = iCustom(NULL,PERIOD_M5,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_5+1);
   double wae_histo_down_5_0 = iCustom(NULL,PERIOD_M5,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_5);
   double wae_histo_down_5_1 = iCustom(NULL,PERIOD_M5,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_5+1);
   
   if (wae_histo_up_5_0 > wae_histo_up_5_1 || wae_histo_down_5_0 < wae_histo_down_5_1) { WAE_Trend_5 = "UP"; x = 866; color_indic = Lime; UP_106 = 1; DOWN_106 = 0; }
   if (wae_histo_up_5_0 < wae_histo_up_5_1 || wae_histo_down_5_0 > wae_histo_down_5_1) { WAE_Trend_5 = "DOWN"; x = 856; color_indic = Red; UP_106 = 0; DOWN_106 = 1; }
   ObjectCreate("Trend_WAE_5", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_5",WAE_Trend_5,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_5", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_5", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_5", OBJPROP_YDISTANCE, 37+add_y);

   double wae_histo_up_15_0 = iCustom(NULL,PERIOD_M15,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_15);
   double wae_histo_up_15_1 = iCustom(NULL,PERIOD_M15,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_15+1);
   double wae_histo_down_15_0 = iCustom(NULL,PERIOD_M15,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_15);
   double wae_histo_down_15_1 = iCustom(NULL,PERIOD_M15,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_15+1);
   
   if (wae_histo_up_15_0 > wae_histo_up_15_1 || wae_histo_down_15_0 < wae_histo_down_15_1) { WAE_Trend_15 = "UP"; x = 866; color_indic = Lime; UP_107 = 1; DOWN_107 = 0; }
   if (wae_histo_up_15_0 < wae_histo_up_15_1 || wae_histo_down_15_0 > wae_histo_down_15_1) { WAE_Trend_15 = "DOWN"; x = 856; color_indic = Red; UP_107 = 0; DOWN_107 = 1; }
   ObjectCreate("Trend_WAE_15", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_15",WAE_Trend_15,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_15", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_15", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_15", OBJPROP_YDISTANCE, 52+add_y);

   double wae_histo_up_30_0 = iCustom(NULL,PERIOD_M30,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_30);
   double wae_histo_up_30_1 = iCustom(NULL,PERIOD_M30,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_30+1);
   double wae_histo_down_30_0 = iCustom(NULL,PERIOD_M30,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_30);
   double wae_histo_down_30_1 = iCustom(NULL,PERIOD_M30,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_30+1);
   
   if (wae_histo_up_30_0 > wae_histo_up_30_1 || wae_histo_down_30_0 < wae_histo_down_30_1) { WAE_Trend_30 = "UP"; x = 866; color_indic = Lime; UP_108 = 1; DOWN_108 = 0; }
   if (wae_histo_up_30_0 < wae_histo_up_30_1 || wae_histo_down_30_0 > wae_histo_down_30_1) { WAE_Trend_30 = "DOWN"; x = 856; color_indic = Red; UP_108 = 0; DOWN_108 = 1; }
   ObjectCreate("Trend_WAE_30", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_30",WAE_Trend_30,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_30", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_30", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_30", OBJPROP_YDISTANCE, 67+add_y);

   double wae_histo_up_60_0 = iCustom(NULL,PERIOD_H1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_60);
   double wae_histo_up_60_1 = iCustom(NULL,PERIOD_H1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_60+1);
   double wae_histo_down_60_0 = iCustom(NULL,PERIOD_H1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_60);
   double wae_histo_down_60_1 = iCustom(NULL,PERIOD_H1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_60+1);
   
   if (wae_histo_up_60_0 > wae_histo_up_60_1 || wae_histo_down_60_0 < wae_histo_down_60_1) { WAE_Trend_60 = "UP"; x = 866; color_indic = Lime; UP_109 = 1; DOWN_109 = 0; }
   if (wae_histo_up_60_0 < wae_histo_up_60_1 || wae_histo_down_60_0 > wae_histo_down_60_1) { WAE_Trend_60 = "DOWN"; x = 856; color_indic = Red; UP_109 = 0; DOWN_109 = 1; }
   ObjectCreate("Trend_WAE_60", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_60",WAE_Trend_60,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_60", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_60", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_60", OBJPROP_YDISTANCE, 82+add_y);

   double wae_histo_up_240_0 = iCustom(NULL,PERIOD_H4,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_240);
   double wae_histo_up_240_1 = iCustom(NULL,PERIOD_H4,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_240+1);
   double wae_histo_down_240_0 = iCustom(NULL,PERIOD_H4,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_240);
   double wae_histo_down_240_1 = iCustom(NULL,PERIOD_H4,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_240+1);
   
   if (wae_histo_up_240_0 > wae_histo_up_240_1 || wae_histo_down_240_0 < wae_histo_down_240_1) { WAE_Trend_240 = "UP"; x = 866; color_indic = Lime; UP_110 = 1; DOWN_110 = 0; }
   if (wae_histo_up_240_0 < wae_histo_up_240_1 || wae_histo_down_240_0 > wae_histo_down_240_1) { WAE_Trend_240 = "DOWN"; x = 856; color_indic = Red; UP_110 = 0; DOWN_110 = 1; }
   ObjectCreate("Trend_WAE_240", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_240",WAE_Trend_240,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_240", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_240", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_240", OBJPROP_YDISTANCE, 97+add_y);

   double wae_histo_up_1440_0 = iCustom(NULL,PERIOD_D1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_1440);
   double wae_histo_up_1440_1 = iCustom(NULL,PERIOD_D1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_1440+1);
   double wae_histo_down_1440_0 = iCustom(NULL,PERIOD_D1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_1440);
   double wae_histo_down_1440_1 = iCustom(NULL,PERIOD_D1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_1440+1);
   
   if (wae_histo_up_1440_0 > wae_histo_up_1440_1 || wae_histo_down_1440_0 < wae_histo_down_1440_1) { WAE_Trend_1440 = "UP"; x = 866; color_indic = Lime; UP_111 = 1; DOWN_111 = 0; }
   if (wae_histo_up_1440_0 < wae_histo_up_1440_1 || wae_histo_down_1440_0 > wae_histo_down_1440_1) { WAE_Trend_1440 = "DOWN"; x = 856; color_indic = Red; UP_111 = 0; DOWN_111 = 1; }
   ObjectCreate("Trend_WAE_1440", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_1440",WAE_Trend_1440,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_1440", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_1440", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_1440", OBJPROP_YDISTANCE, 112+add_y);
   
   /*
   double wae_histo_up_10080_0 = iCustom(NULL,PERIOD_W1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_10080);
   double wae_histo_up_10080_1 = iCustom(NULL,PERIOD_W1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,0,shift_10080+1);
   double wae_histo_down_10080_0 = iCustom(NULL,PERIOD_W1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_10080);
   double wae_histo_down_10080_1 = iCustom(NULL,PERIOD_W1,"Waddah_Attar_Explosion",150,30,15,15,false,1,true,true,true,true,1,shift_10080+1);
   
   if (wae_histo_up_10080_0 > wae_histo_up_10080_1 || wae_histo_down_10080_0 < wae_histo_down_10080_1) { WAE_Trend_10080 = "UP"; x = 866; color_indic = Lime; UP_112 = 1; DOWN_112 = 0; }
   if (wae_histo_up_10080_0 < wae_histo_up_10080_1 || wae_histo_down_10080_0 > wae_histo_down_10080_1) { WAE_Trend_10080 = "DOWN"; x = 856; color_indic = Red; UP_112 = 0; DOWN_112 = 1; }
   ObjectCreate("Trend_WAE_10080", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_WAE_10080",WAE_Trend_10080,7, "Verdana", color_indic);
   ObjectSet("Trend_WAE_10080", OBJPROP_CORNER, 0);
   ObjectSet("Trend_WAE_10080", OBJPROP_XDISTANCE, x+add_x);
   ObjectSet("Trend_WAE_10080", OBJPROP_YDISTANCE, 127+add_y);
   */
   
//Calculation of the trend. Let's give high TFs more "force"
   
   double Trend_UP_1 = iCustom(NULL,0,"FerruFx_Trend+","=== SUM must be = 7 ===",coef_m1,coef_m5,coef_m15,coef_m30,coef_H1,coef_H4,coef_D1 /* ,coef_W1 */ ,"=== Format: 2007.05.07 00:00 ===",look_time_shift,shift_indicators,test,0,0);
   double Trend_DOWN_1 = iCustom(NULL,0,"FerruFx_Trend+","=== SUM must be = 7 ===",coef_m1,coef_m5,coef_m15,coef_m30,coef_H1,coef_H4,coef_D1 /* ,coef_W1 */ ,"=== Format: 2007.05.07 00:00 ===",look_time_shift,shift_indicators,test,1,0);
      
   double UP_m1 = (UP_65 + UP_73 + UP_81 + UP_89 + UP_97 + UP_105) * coef_m1;
   double UP_m5 = (UP_66 + UP_74 + UP_82 + UP_90 + UP_98 + UP_106) * coef_m5;
   double UP_m15 = (UP_67 + UP_75 + UP_83 + UP_91 + UP_99 + UP_107) * coef_m15;
   double UP_m30 = (UP_68 + UP_76 + UP_84 + UP_92 + UP_100 + UP_108) * coef_m30;
   double UP_H1 = (UP_69 + UP_77 + UP_85 + UP_93 + UP_101 + UP_109) * coef_H1;
   double UP_H4 = (UP_70 + UP_78 + UP_86 + UP_94 + UP_102 + UP_110) * coef_H4;
   double UP_D1 = (UP_71 + UP_79 + UP_87 + UP_95 + UP_103 + UP_111) * coef_D1;
   // double UP_W1 = (UP_72 + UP_80 + UP_88 + UP_96 + UP_104 + UP_112) * coef_W1;
   
   double Trend_UP_2 = UP_m1 + UP_m5 + UP_m15 + UP_m30 + UP_H1 + UP_H4 + UP_D1 /* + UP_W1 */ ;
       
   double DOWN_m1 = (DOWN_65 + DOWN_73 + DOWN_81 + DOWN_89 + DOWN_97 + DOWN_105) * coef_m1;
   double DOWN_m5 = (DOWN_66 + DOWN_74 + DOWN_82 + DOWN_90 + DOWN_98 + DOWN_106) * coef_m5;
   double DOWN_m15 = (DOWN_67 + DOWN_75 + DOWN_83 + DOWN_91 + DOWN_99 + DOWN_107) * coef_m15;
   double DOWN_m30 = (DOWN_68 + DOWN_76 + DOWN_84 + DOWN_92 + DOWN_100 + DOWN_108) * coef_m30;
   double DOWN_H1 = (DOWN_69 + DOWN_77 + DOWN_85 + DOWN_93 + DOWN_101 + DOWN_109) * coef_H1;
   double DOWN_H4 = (DOWN_70 + DOWN_78 + DOWN_86 + DOWN_94 + DOWN_102 + DOWN_110) * coef_H4;
   double DOWN_D1 = (DOWN_71 + DOWN_79 + DOWN_87 + DOWN_95 + DOWN_103 + DOWN_111) * coef_D1;
   // double DOWN_W1 = (DOWN_72 + DOWN_80 + DOWN_88 + DOWN_96 + DOWN_104 + DOWN_112) * coef_W1;
                               
   double Trend_DOWN_2 = DOWN_m1 + DOWN_m5 + DOWN_m15 + DOWN_m30 + DOWN_H1 + DOWN_H4 + DOWN_D1 /* + DOWN_W1 */ ;
                             
   string Trend_UP = DoubleToStr((((Trend_UP_1 + Trend_UP_2)/98)*100),0);
   string Trend_DOWN = DoubleToStr((100 - StrToDouble(Trend_UP)),0);
   
/*
   Buffers for EA
   
   TrendUPBuffer[0] = ((Trend_UP_1 + Trend_UP_2)/98)*100;
   TrendDOWNBuffer[0] = 100 - (((Trend_UP_1 + Trend_UP_2)/98)*100);
   
*/
   
   ObjectCreate("Trend_UP", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_UP","+   Trend   +",9, "Verdana", DarkOrange);
   ObjectSet("Trend_UP", OBJPROP_CORNER, 0);
   ObjectSet("Trend_UP", OBJPROP_XDISTANCE, 908+add_x);
   ObjectSet("Trend_UP", OBJPROP_YDISTANCE, -5+add_y);
   
   ObjectCreate("line9", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("line9","----------------",8, "Verdana", DarkOrange);
   ObjectSet("line9", OBJPROP_CORNER, 0);
   ObjectSet("line9", OBJPROP_XDISTANCE, 907+add_x);
   ObjectSet("line9", OBJPROP_YDISTANCE, 6+add_y);
   
   ObjectCreate("Trend_UP_text", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_UP_text","UP",9, "Verdana", Lime);
   ObjectSet("Trend_UP_text", OBJPROP_CORNER, 0);
   ObjectSet("Trend_UP_text", OBJPROP_XDISTANCE, 909+add_x);
   ObjectSet("Trend_UP_text", OBJPROP_YDISTANCE, 20+add_y);
   
   ObjectCreate("Trend_UP_value", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_UP_value",Trend_UP+"%",9, "Verdana", PeachPuff);
   ObjectSet("Trend_UP_value", OBJPROP_CORNER, 0);
   ObjectSet("Trend_UP_value", OBJPROP_XDISTANCE, 955+add_x);
   ObjectSet("Trend_UP_value", OBJPROP_YDISTANCE, 20+add_y);
   
   ObjectCreate("Trend_DOWN_text", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DOWN_text","DOWN",9, "Verdana", Red);
   ObjectSet("Trend_DOWN_text", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DOWN_text", OBJPROP_XDISTANCE, 909+add_x);
   ObjectSet("Trend_DOWN_text", OBJPROP_YDISTANCE, 40+add_y);
   
   ObjectCreate("Trend_DOWN_value", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_DOWN_value",Trend_DOWN+"%",9, "Verdana", PeachPuff);
   ObjectSet("Trend_DOWN_value", OBJPROP_CORNER, 0);
   ObjectSet("Trend_DOWN_value", OBJPROP_XDISTANCE, 955+add_x);
   ObjectSet("Trend_DOWN_value", OBJPROP_YDISTANCE, 40+add_y);
   
   string trend;
   string comment;
   color coltrend;
   color colcomment;
   double xt, xc;
   
   if(StrToDouble(Trend_UP) >= TrendStrongLevel) { trend = "UP"; coltrend = Lime; xt = 935; comment = "[strong]"; xc = 921; colcomment = Lime; /* if (alert == true) { Alert(TimeToStr(TimeCurrent(),TIME_SECONDS)," Trend UP > "TrendStrongLevel"% on ",Symbol()," ", Bid); PlaySound("tick.wav"); } */ }
   else if(StrToDouble(Trend_UP) < TrendStrongLevel && StrToDouble(Trend_UP) >= 50) { trend = "UP"; coltrend = Lime; xt = 935; comment = "[weak]"; xc = 924; colcomment = Orange; }
   else if(StrToDouble(Trend_DOWN) >= TrendStrongLevel) { trend = "DOWN"; coltrend = Red; xt = 918; comment = "[strong]"; xc = 921; colcomment = Red; /* if (alert == true) { Alert(TimeToStr(TimeCurrent(),TIME_SECONDS)," Trend DOWN > "TrendStrongLevel"% on ",Symbol()," ", Bid); PlaySound("tick.wav"); } */ }
   else if(StrToDouble(Trend_DOWN) < TrendStrongLevel && StrToDouble(Trend_DOWN) > 50) { trend = "DOWN"; coltrend = Red; xt = 918; comment = "[weak]"; xc = 924; colcomment = Orange; }
   
   ObjectCreate("line10", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("line10","----------------",8, "Verdana", coltrend);
   ObjectSet("line10", OBJPROP_CORNER, 0);
   ObjectSet("line10", OBJPROP_XDISTANCE, 907+add_x);
   ObjectSet("line10", OBJPROP_YDISTANCE, 55+add_y);
   
   ObjectCreate("line12", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("line12","----------------",8, "Verdana", coltrend);
   ObjectSet("line12", OBJPROP_CORNER, 0);
   ObjectSet("line12", OBJPROP_XDISTANCE, 907+add_x);
   ObjectSet("line12", OBJPROP_YDISTANCE, 58+add_y);
   
   ObjectCreate("Trend", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend",trend,18, "Impact", coltrend);
   ObjectSet("Trend", OBJPROP_CORNER, 0);
   ObjectSet("Trend", OBJPROP_XDISTANCE, xt+add_x);
   ObjectSet("Trend", OBJPROP_YDISTANCE, 70+add_y);
   
   ObjectCreate("Trend_comment", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("Trend_comment",comment,10, "Verdana", colcomment);
   ObjectSet("Trend_comment", OBJPROP_CORNER, 0);
   ObjectSet("Trend_comment", OBJPROP_XDISTANCE, xc+add_x);
   ObjectSet("Trend_comment", OBJPROP_YDISTANCE, 100+add_y);
   
   ObjectCreate("line13", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("line13","----------------",8, "Verdana", coltrend);
   ObjectSet("line13", OBJPROP_CORNER, 0);
   ObjectSet("line13", OBJPROP_XDISTANCE, 907+add_x);
   ObjectSet("line13", OBJPROP_YDISTANCE, 117+add_y);
   
   ObjectCreate("line11", OBJ_LABEL, WindowFind("FerruFx_Trend+"), 0, 0);
   ObjectSetText("line11","----------------",8, "Verdana", coltrend);
   ObjectSet("line11", OBJPROP_CORNER, 0);
   ObjectSet("line11", OBJPROP_XDISTANCE, 907+add_x);
   ObjectSet("line11", OBJPROP_YDISTANCE, 120+add_y);
   
   
   return(0);
  }

Comments