_TRO_Multi_Meter_SAR_001
Download scriptThis script is designed as a multi-timeframe visual dashboard for MetaTrader. It allows traders to monitor the current market trend across several different time periods simultaneously without having to switch between individual charts.
Core Functionality
The tool utilizes the Parabolic SAR (Stop and Reverse) indicator, which is a common technical analysis tool used to identify price reversals and potential trend directions. Rather than displaying this indicator directly on your main price candles, this script calculates the SAR values for seven different timeframes at once:
- 1 Minute (M1)
- 5 Minutes (M5)
- 15 Minutes (M15)
- 30 Minutes (M30)
- 1 Hour (H1)
- 4 Hours (H4)
- Daily (D1)
How it Works
- Data Gathering: The script constantly looks at the current market price and compares it against the Parabolic SAR calculation for each of the seven timeframes mentioned above.
- Trend Detection: It determines the "bias" for each timeframe based on where the current price sits in relation to the SAR value:
- If the price is above the SAR value, the trend is considered bullish (upward).
- If the price is below the SAR value, the trend is considered bearish (downward).
- Visual Dashboard: Instead of showing lines or dots on the chart, the script creates a clean text-based dashboard in one of the corners of your screen.
Visual Representation
The dashboard provides a quick-glance summary using colors:
- Lime Green: Indicates that the price is currently trending upwards on that specific timeframe.
- Red: Indicates that the price is currently trending downwards on that specific timeframe.
User Customization
The script includes several settings to help tailor the experience to your specific trading setup:
- Heading Toggle: You can choose whether or not to display the labels for the different timeframes (M1, M5, H1, etc.).
- Positioning: You can adjust where the dashboard appears on your screen (e.g., Top Right vs. other areas) and fine-tune the horizontal and vertical "shift" to ensure it doesn't overlap with other indicators or price action.
- Color Schemes: You can modify the specific colors used for the labels to suit your visual preferences.
Summary for the Trader
This tool serves as a "Trend Radar." By looking at one corner of your chart, you can immediately see if the short-term trends (like M1 or M5) align with the long-term trends (like H4 or D1). This helps in making more informed decisions by ensuring that your trade direction is supported by multiple timeframes at once.
//+------------------------------------------------------------------+
//| _TRO_Multi_Meter_SAR |
//| |
//| Copyright © 2007, Avery T. Horton, Jr. aka TheRumpledOne |
//| |
//| PO BOX 43575, TUCSON, AZ 85733 |
//| |
//| GIFT AND DONATIONS ACCEPTED |
//| |
//| therumpldone@gmail.com |
//+------------------------------------------------------------------+
#property indicator_chart_window
extern bool Show_Heading = false;
extern string IndName = "SAR" ; // change
//*******************
// change inputs for your indicator
extern double SAR_Step = 0.02;
extern double SAR_Max = 0.2;
//*******************
extern bool Corner_of_Chart_RIGHT_TOP = true;
extern int Shift_UP_DN =0;
extern int Adjust_Side_to_side = 20;
extern color BarLabel_color = LightBlue;
extern color CommentLabel_color = LightBlue;
string Obj0001,Obj0002,Obj0003,Obj0004,Obj0005,Obj0006,Obj0007,Obj0008,Obj0009;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//***********************************************************************************************************************
string LabelTime="";
if (LabelTime=="") {LabelTime=TimeToStr(TimeLocal(),TIME_SECONDS); }
int counted_bars=IndicatorCounted();
if ( Show_Heading) {
if (Corner_of_Chart_RIGHT_TOP == true)
{
string Obj0001 = "Numbers" + LabelTime ;
ObjectCreate(Obj0001, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0001, " M1 M5 M15 M30 H1 H4 D1", 7, "Tahoma Narrow", BarLabel_color);
ObjectSet(Obj0001, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0001, OBJPROP_XDISTANCE, 17+Adjust_Side_to_side);
ObjectSet(Obj0001, OBJPROP_YDISTANCE, 28+Shift_UP_DN);
}
if (Corner_of_Chart_RIGHT_TOP == false)
{
ObjectCreate(Obj0001, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0001, " M1 M5 M15 M30 H1 H4 D1", 7, "Tahoma Narrow", BarLabel_color);
ObjectSet(Obj0001, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0001, OBJPROP_XDISTANCE, 17+Adjust_Side_to_side);
ObjectSet(Obj0001, OBJPROP_YDISTANCE, 24+Shift_UP_DN);
}
} // Show_Heading
//******************* change for your indicator ********************
//MAX Signals
double SAR_M1 = iSAR(Symbol(),1,SAR_Step,SAR_Max,0);
//double MAX_m1 = iMA(Symbol(),1,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
double SAR_M5 = iSAR(Symbol(),5,SAR_Step,SAR_Max,0);
//double MAX_m5 = iMA(Symbol(),5,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
double SAR_M15 = iSAR(Symbol(),15,SAR_Step,SAR_Max,0);
//double MAX_m15 = iMA(Symbol(),15,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
double SAR_M30 = iSAR(Symbol(),30,SAR_Step,SAR_Max,0);
//double MAX_m30 = iMA(Symbol(),30,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
double SAR_H1 = iSAR(Symbol(),60,SAR_Step,SAR_Max,0);
//double MAX_h1 = iMA(Symbol(),60,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
double SAR_H4 = iSAR(Symbol(),240,SAR_Step,SAR_Max,0);
//double MAX_h4 = iMA(Symbol(),240,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
double SAR_D1 = iSAR(Symbol(),1440,SAR_Step,SAR_Max,0);
//double MAX_d1 = iMA(Symbol(),1440,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
// double MAX_W1 = iMA(Symbol(),10080,MA_Fast,0,MA_MODE,MA_PRICE_TYPE,0);
// double MAX_w1 = iMA(Symbol(),10080,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
string M1_SAR= "",M5_SAR= "", M15_SAR= "", M30_SAR= "", H1_SAR= "", H4_SAR= "", D1_SAR= "",PRC1;
color color_SARm1,color_SARm5,color_SARm15,color_SARm30,color_SARm60,color_SARm240,color_SARm1440;
if (Close[0] > SAR_M1) {M1_SAR= "-";color_SARm1 = Lime; }
if (Close[0] <= SAR_M1) {M1_SAR= "-";color_SARm1 = Red; }
if (Close[0] > SAR_M5) {M5_SAR= "-";color_SARm5 = Lime; }
if (Close[0] <= SAR_M5) {M5_SAR= "-";color_SARm5 = Red; }
if (Close[0] > SAR_M15) {M15_SAR= "-";color_SARm15 = Lime; }
if (Close[0] <= SAR_M15) {M15_SAR= "-";color_SARm15 = Red; }
if (Close[0] > SAR_M30) {M30_SAR= "-";color_SARm30 = Lime; }
if (Close[0] <= SAR_M30) {M30_SAR= "-";color_SARm30 = Red; }
if (Close[0] > SAR_M1) {H1_SAR= "-";color_SARm60 = Lime; }
if (Close[0] <= SAR_M1) {H1_SAR= "-";color_SARm60 = Red; }
if (Close[0] > SAR_H4) {H4_SAR= "-";color_SARm240 = Lime; }
if (Close[0] <= SAR_H4) {H4_SAR= "-";color_SARm240 = Red; }
if (Close[0] > SAR_D1) {D1_SAR= "-";color_SARm1440 = Lime; }
if (Close[0] <= SAR_D1) {D1_SAR= "-";color_SARm1440 = Red; }
string Obj0002 = "SignalMAXM1t" + LabelTime ;
ObjectCreate(Obj0002, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0002,IndName, 7, "Tahoma Narrow", BarLabel_color);
ObjectSet(Obj0002, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0002, OBJPROP_XDISTANCE, 155+Adjust_Side_to_side);
ObjectSet(Obj0002, OBJPROP_YDISTANCE, 50+Shift_UP_DN);
string Obj0003 = "SignalMAXM1" + LabelTime ;
ObjectCreate(Obj0003, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0003, M1_SAR, 40, "Tahoma Narrow", color_SARm1);
ObjectSet(Obj0003, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0003, OBJPROP_XDISTANCE, 130+Adjust_Side_to_side);
ObjectSet(Obj0003, OBJPROP_YDISTANCE, 20+Shift_UP_DN);
string Obj0004 = "SignalMAXM5" + LabelTime ;
ObjectCreate(Obj0004, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0004, M5_SAR, 40, "Tahoma Narrow", color_SARm5);
ObjectSet(Obj0004, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0004, OBJPROP_XDISTANCE, 110+Adjust_Side_to_side);
ObjectSet(Obj0004, OBJPROP_YDISTANCE, 20+Shift_UP_DN);
string Obj0005 = "SignalMAXM15" + LabelTime ;
ObjectCreate(Obj0005, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0005, M15_SAR, 40, "Tahoma Narrow", color_SARm15);
ObjectSet(Obj0005, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0005, OBJPROP_XDISTANCE, 90+Adjust_Side_to_side);
ObjectSet(Obj0005, OBJPROP_YDISTANCE, 20+Shift_UP_DN);
string Obj0006 = "SignalMAXM30" + LabelTime ;
ObjectCreate(Obj0006, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0006, M30_SAR, 40, "Tahoma Narrow", color_SARm30);
ObjectSet(Obj0006, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0006, OBJPROP_XDISTANCE, 70+Adjust_Side_to_side);
ObjectSet(Obj0006, OBJPROP_YDISTANCE, 20+Shift_UP_DN);
string Obj0007 = "SignalMAXM60" + LabelTime ;
ObjectCreate(Obj0007, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0007, H1_SAR, 40, "Tahoma Narrow", color_SARm60);
ObjectSet(Obj0007, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0007, OBJPROP_XDISTANCE, 50+Adjust_Side_to_side);
ObjectSet(Obj0007, OBJPROP_YDISTANCE, 20+Shift_UP_DN);
string Obj0008 = "SignalMAXM240" + LabelTime ;
ObjectCreate(Obj0008, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0008, H4_SAR, 40, "Tahoma Narrow", color_SARm240);
ObjectSet(Obj0008, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0008, OBJPROP_XDISTANCE, 30+Adjust_Side_to_side);
ObjectSet(Obj0008, OBJPROP_YDISTANCE, 20+Shift_UP_DN);
string Obj0009 = "SignalMAXM1440" + LabelTime ;
ObjectCreate(Obj0009, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Obj0009, D1_SAR, 40, "Tahoma Narrow", color_SARm1440);
ObjectSet(Obj0009, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet(Obj0009, OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet(Obj0009, OBJPROP_YDISTANCE, 20+Shift_UP_DN);
//----
return(0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
// deleteObject(Obj0001,Obj0002,Obj0003,Obj0004,Obj0005,Obj0006,Obj0007,Obj0008,Obj0009);
ObjectsDeleteAll(0,OBJ_HLINE);
ObjectsDeleteAll(0,OBJ_TEXT);
ObjectsDeleteAll(0,OBJ_LABEL);
deleteObject();
//----
return(0);
}
void deleteObject()
{
ObjectDelete(Obj0001);
ObjectDelete(Obj0002);
ObjectDelete(Obj0003);
ObjectDelete(Obj0004);
ObjectDelete(Obj0005);
ObjectDelete(Obj0006);
ObjectDelete(Obj0007);
ObjectDelete(Obj0008);
ObjectDelete(Obj0009);
}
Comments