Author: Copyright ? 2008, ValasSSP
valasssp

System Overview

The Valas SSP is a multi-currency trading indicator designed for the MetaTrader platform. It functions as an automated scanner that monitors several major and minor currency pairs simultaneously. Its primary purpose is to identify specific market conditions across different timeframes—ranging from 30-minute charts to daily charts—to provide visual "Buy" or "Sell" signals along with suggested profit targets.

Key Logic Components

1. Security and Validity Check

Before the tool performs any analysis, it includes a built-in expiration check. It verifies the current system date against a hardcoded deadline. If the current date exceeds this limit, the script will trigger an alert notification informing the user that the service has expired and providing contact information for renewal.

2. Multi-Timeframe Trend Analysis

The core logic relies on "Moving Averages" (EMA) calculated across four distinct timeframes: 30-minute (M30), 1-hour (H1), 4-hour (H4), and Daily (D1). The system looks for alignment between these periods to ensure that short-term moves are supported by long-term trends.

3. Signal Confirmation Filters

To filter out "false" signals, the script utilizes a combination of three distinct technical indicators:

  • RSI (Relative Strength Index): Measures the speed and change of price movements to determine if a market is overbought or oversold.
  • MACD (Moving Average Convergence Divergence): Used twice with different settings to confirm momentum in both directions.
  • Price Action Stability: The script performs a unique "cross-count" check on recent price bars to ensure the market isn't experiencing erratic, high-frequency volatility that could lead to unreliable signals.

4. Signal Generation Rules

The indicator categorizes its signals into four distinct logical paths:

  • Strong Buy: Triggered when trends are positive across all timeframes, RSI is above 50, and both MACD indicators show upward momentum. It identifies the previous day's high as a reference point.
  • Strong Sell: Triggered when trends are negative across all timeframes, RSI is below 50, and both MACD indicators show downward momentum. It identifies the previous day's low as a reference point.
  • Bullish Correction/Entry: Triggered when most timeframes are bullish, but there is a specific divergence in the daily trend, allowing for entries at calculated price levels based on daily highs and lows.
  • Bearish Correction/Entry: Similar to the bullish correction, this triggers when most timeframes are bearish with a specific daily trend divergence, identifying entry points based on daily extremes.

5. Visual Display and User Interface

Once the logic determines a signal, the script dynamically updates a separate window on your screen. For each currency pair monitored, it displays:

  • The Currency Name: Clearly identifies which pair is being analyzed.
  • Action Label: A "Buy" (in Lime) or "Sell" (in Red) label.
  • Take Profit (TP): A designated target price for the trade.
  • Price Reference: The specific technical price point (e.g., high, low, or calculated midpoint) used to derive the signal.
  • Spread Information: Displays the current market spread to help users assess trading costs in real-time.
Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains close prices for each bar
Indicators Used
Moving average indicatorRelative strength indexMACD HistogramStochastic oscillator
Miscellaneous
It issuies visual alerts to the screen
8 Views
0 Downloads
0 Favorites
valasssp
#property copyright "Copyright ? 2008, ValasSSP"
#property link "email:admin@valasssp.com"

#property indicator_separate_window

int init() {
IndicatorShortName("Valas SSP");
return (0);
}

int deinit() {
ObjectsDeleteAll(1, OBJ_LABEL);
return (0);
}

int start() {
int li_0 = 2010;
int li_4 = 4;
int li_8 = 30;
string ls_12 = "admin@valasssp.com";
string ls_20 = "Valas SSP";
if (TimeYear(Time[0]) > li_0) {
Alert(ls_20 + " has expired. ", "Please contact" + ls_12);
return (0);
}
if (TimeYear(Time[0]) == li_0 && TimeMonth(Time[0]) > li_4) {
Alert(ls_20 + " has expired. ", "Please contact" + ls_12);
return (0);
}
if (TimeYear(Time[0]) == li_0 && TimeMonth(Time[0]) == li_4 && TimeDay(Time[0]) > li_8) {
Alert(ls_20 + " has expired. ", "Please contact" + ls_12);
return (0);
}
alerts("EURUSD", "label-01", "arrow-01", "ttp-01", "tp-01", "act-01", 2, 38);
alerts("GBPUSD", "label-02", "arrow-02", "ttp-02", "tp-02", "act-02", 2, 56);
alerts("AUDUSD", "label-03", "arrow-03", "ttp-03", "tp-03", "act-03", 2, 74);
alerts("NZDUSD", "label-04", "arrow-04", "ttp-04", "tp-04", "act-04", 2, 92);
alerts("EURGBP", "label-05", "arrow-05", "ttp-05", "tp-05", "act-05", 2, 128);
alerts("USDJPY", "label-06", "arrow-06", "ttp-06", "tp-06", "act-06", 225, 38);
alerts("EURJPY", "label-07", "arrow-07", "ttp-07", "tp-07", "act-07", 225, 56);
alerts("CHFJPY", "label-08", "arrow-08", "ttp-08", "tp-08", "act-08", 225, 74);
alerts("AUDJPY", "label-09", "arrow-09", "ttp-09", "tp-09", "act-09", 225, 92);
alerts("CADJPY", "label-10", "arrow-10", "ttp-10", "tp-10", "act-10", 225, 110);
alerts("GBPJPY", "label-11", "arrow-11", "ttp-11", "tp-11", "act-11", 225, 128);
alerts("EURCHF", "label-12", "arrow-12", "ttp-12", "tp-12", "act-12", 480, 38);
alerts("USDCHF", "label-13", "arrow-13", "ttp-13", "tp-13", "act-13", 480, 56);
alerts("GBPCHF", "label-14", "arrow-14", "ttp-14", "tp-14", "act-14", 480, 74);
alerts("CADCHF", "label-15", "arrow-15", "ttp-15", "tp-15", "act-15", 480, 92);
alerts("NZDCHF", "label-16", "arrow-16", "ttp-16", "tp-16", "act-16", 480, 110);
alerts("AUDCHF", "label-17", "arrow-17", "ttp-17", "tp-17", "act-17", 480, 128);
alerts("USDCAD", "label-18", "arrow-18", "ttp-18", "tp-18", "act-18", 700, 38);
alerts("AUDCAD", "label-19", "arrow-19", "ttp-19", "tp-19", "act-19", 700, 56);
alerts("EURCAD", "label-20", "arrow-20", "ttp-20", "tp-20", "act-20", 700, 74);
alerts("NZDCAD", "label-21", "arrow-21", "ttp-21", "tp-21", "act-21", 700, 92);
alerts("CHFCAD", "label-22", "arrow-22", "ttp-22", "tp-22", "act-22", 700, 110);
alerts("GBPCAD", "label-23", "arrow-23", "ttp-23", "tp-23", "act-23", 700, 128);
return (0);
}

void alerts(string a_symbol_0, string a_name_8, string a_name_16, string a_name_24, string a_name_32, string a_name_40, int a_x_48, int a_y_52) {
string ls_unused_176;
double l_ima_184;
double l_ima_192;
double l_ima_200;
double l_ima_208;
color l_color_220;
string l_text_224;
color l_color_232;
string l_text_236;
color l_color_244;
string l_text_248;
color l_color_256;
string ls_unused_284;
string ls_unused_292;
string ls_unused_300;
string ls_unused_308;
int li_332;
string ls_56 = "Valas SSP";
double l_point_64 = MarketInfo(a_symbol_0, MODE_POINT);
int l_period_72 = 24;
int l_period_76 = 72;
double l_ima_80 = iMA(a_symbol_0, PERIOD_M30, l_period_72, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_88 = iMA(a_symbol_0, PERIOD_M30, l_period_76, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_96 = iMA(a_symbol_0, PERIOD_H1, l_period_72, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_104 = iMA(a_symbol_0, PERIOD_H1, l_period_76, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_112 = iMA(a_symbol_0, PERIOD_H4, l_period_72, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_120 = iMA(a_symbol_0, PERIOD_H4, l_period_76, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_128 = iMA(a_symbol_0, PERIOD_D1, l_period_72, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_136 = iMA(a_symbol_0, PERIOD_D1, l_period_76, 0, MODE_EMA, PRICE_CLOSE, 0);
int l_bool_144 = l_ima_80 > l_ima_88 && l_ima_96 > l_ima_104 && l_ima_112 > l_ima_120 && l_ima_128 > l_ima_136;
int l_bool_148 = l_ima_80 < l_ima_88 && l_ima_96 < l_ima_104 && l_ima_112 < l_ima_120 && l_ima_128 < l_ima_136;
int l_bool_152 = l_ima_80 > l_ima_88 && l_ima_96 > l_ima_104 && l_ima_112 > l_ima_120 && l_ima_128 < l_ima_136;
int l_bool_156 = l_ima_80 < l_ima_88 && l_ima_96 < l_ima_104 && l_ima_112 < l_ima_120 && l_ima_128 > l_ima_136;
int l_count_160 = 0;
int li_164 = 49;
int l_count_168 = 0;
for (l_count_160 = 1; l_count_160 < li_164; l_count_160++) {
l_ima_184 = iMA(a_symbol_0, PERIOD_M30, 24, 0, MODE_EMA, PRICE_CLOSE, l_count_160 - 1);
l_ima_192 = iMA(a_symbol_0, PERIOD_M30, 72, 0, MODE_EMA, PRICE_CLOSE, l_count_160 - 1);
l_ima_200 = iMA(a_symbol_0, PERIOD_M30, 24, 0, MODE_EMA, PRICE_CLOSE, l_count_160 + 1);
l_ima_208 = iMA(a_symbol_0, PERIOD_M30, 72, 0, MODE_EMA, PRICE_CLOSE, l_count_160 + 1);
if ((l_ima_184 > l_ima_192 && l_ima_200 < l_ima_208) || (l_ima_184 < l_ima_192 && l_ima_200 > l_ima_208)) l_count_168++;
}
int li_216 = l_count_168 < 1;
double l_spread_316 = MarketInfo(a_symbol_0, MODE_SPREAD);
string l_dbl2str_276 = DoubleToStr(l_spread_316, 0);
double l_ask_324 = MarketInfo(a_symbol_0, MODE_ASK);
if (l_ask_324 > 10.0) li_332 = 2;
else li_332 = 4;
double l_ihigh_336 = iHigh(a_symbol_0, PERIOD_D1, 1);
double l_ilow_344 = iLow(a_symbol_0, PERIOD_D1, 1);
double l_iclose_352 = iClose(a_symbol_0, PERIOD_D1, 1);
double ld_360 = (l_ihigh_336 + l_ilow_344 + l_iclose_352) / 3.0;
ld_360 = NormalizeDouble(ld_360, li_332);
double ld_368 = 2.0 * ld_360 - l_ihigh_336;
ld_368 = NormalizeDouble(ld_368, li_332);
double ld_376 = 2.0 * ld_360 - l_ilow_344;
ld_376 = NormalizeDouble(ld_376, li_332);
double l_irsi_384 = iRSI(a_symbol_0, PERIOD_M30, 14, PRICE_CLOSE, 0);
double l_imacd_392 = iMACD(a_symbol_0, PERIOD_M30, 5, 13, 1, PRICE_CLOSE, MODE_MAIN, 0);
double l_imacd_400 = iMACD(a_symbol_0, PERIOD_M30, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 0);
double l_istochastic_408 = iStochastic(a_symbol_0, PERIOD_M30, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0);
if (l_bool_144 && li_216 && l_irsi_384 > 50.0 && l_imacd_392 > 0.0 && l_imacd_400 > 0.0) {
l_text_224 = "Buy";
l_color_220 = Lime;
l_color_256 = Lime;
l_text_236 = l_ihigh_336;
l_color_232 = Lime;
l_text_248 = "TP";
l_color_244 = Lime;
} else {
if (l_bool_148 && li_216 && l_irsi_384 < 50.0 && l_imacd_392 < 0.0 && l_imacd_400 < 0.0) {
l_text_224 = "Sell";
l_color_220 = Red;
l_color_256 = Red;
l_text_236 = l_ilow_344;
l_color_232 = Red;
l_text_248 = "TP";
l_color_244 = Red;
} else {
if (l_bool_152 && li_216) {
l_text_224 = "Buy";
l_color_220 = Lime;
l_color_256 = Lime;
l_text_236 = ld_376;
l_color_232 = Lime;
l_text_248 = "TP";
l_color_244 = Lime;
} else {
if (l_bool_156 && li_216) {
l_text_224 = "Sell";
l_color_220 = Red;
l_color_256 = Red;
l_text_236 = ld_368;
l_color_232 = Red;
l_text_248 = "TP";
l_color_244 = Red;
} else {
l_text_224 = "";
l_color_220 = Black;
l_color_256 = Gray;
l_text_236 = "";
l_color_232 = Black;
l_text_248 = "";
l_color_244 = Black;
}
}
}
}
ObjectCreate(a_name_16, OBJ_LABEL, WindowFind(ls_56), 0, 0);
ObjectSetText(a_name_16, l_dbl2str_276, 7, "Arial Bold", Yellow);
ObjectSet(a_name_16, OBJPROP_CORNER, 0);
ObjectSet(a_name_16, OBJPROP_XDISTANCE, a_x_48);
ObjectSet(a_name_16, OBJPROP_YDISTANCE, a_y_52 + 2);
ObjectCreate(a_name_8, OBJ_LABEL, WindowFind(ls_56), 0, 0);
ObjectSetText(a_name_8, a_symbol_0, 9, "Arial Bold", l_color_256);
ObjectSet(a_name_8, OBJPROP_CORNER, 0);
ObjectSet(a_name_8, OBJPROP_XDISTANCE, a_x_48 + 13);
ObjectSet(a_name_8, OBJPROP_YDISTANCE, a_y_52);
ObjectCreate(a_name_40, OBJ_LABEL, WindowFind(ls_56), 0, 0);
ObjectSetText(a_name_40, l_text_224, 10, "Arial Bold", l_color_220);
ObjectSet(a_name_40, OBJPROP_CORNER, 0);
ObjectSet(a_name_40, OBJPROP_XDISTANCE, a_x_48 + 65);
ObjectSet(a_name_40, OBJPROP_YDISTANCE, a_y_52 + 0);
ObjectCreate(a_name_32, OBJ_LABEL, WindowFind(ls_56), 0, 0);
ObjectSetText(a_name_32, l_text_248, 10, "Arial Bold", l_color_244);
ObjectSet(a_name_32, OBJPROP_CORNER, 0);
ObjectSet(a_name_32, OBJPROP_XDISTANCE, a_x_48 + 98);
ObjectSet(a_name_32, OBJPROP_YDISTANCE, a_y_52 + 0);
ObjectCreate(a_name_24, OBJ_LABEL, WindowFind(ls_56), 0, 0);
ObjectSetText(a_name_24, l_text_236, 10, "Arial Bold", l_color_232);
ObjectSet(a_name_24, OBJPROP_CORNER, 0);
ObjectSet(a_name_24, OBJPROP_XDISTANCE, a_x_48 + 120);
ObjectSet(a_name_24, OBJPROP_YDISTANCE, a_y_52 + 0);
}

Comments