_TRO_Multi_Meter_SAR
Download scriptThis script is designed to provide traders with a multi-timeframe overview of market trends at a single glance. Instead of requiring you to switch between different charts to see what is happening on various time periods, it gathers that data and displays it as a simplified dashboard directly on your current screen.
Core Functionality
The logic operates by calculating the Parabolic SAR (Stop and Reverse) indicator across seven different timeframes simultaneously:
- Short-term: 1 Minute, 5 Minutes, 15 Minutes, and 30 Minutes.
- Long-term: 1 Hour, 4 Hours, and Daily (D1).
How the Logic Works
The script performs three primary actions to provide this information:
1. Multi-Timeframe Data Retrieval The script looks at the current price of the asset you are trading and compares it against the Parabolic SAR value for every one of the timeframes listed above. It does this in real-time, ensuring that the data remains current as new price ticks arrive.
2. Trend Identification (Color Coding) To make the information easy to digest quickly, the script interprets the relationship between the price and the SAR indicator:
- Bullish Signal: If the current price is above the SAR value for a specific timeframe, the script identifies this as an upward trend and assigns it a Lime (Green) color.
- Bearish Signal: If the current price is below the SAR value for that timeframe, the script identifies this as a downward trend and assigns it a Red color.
3. Visual Dashboard Display Rather than drawing lines across your chart (which can often clutter the screen), the script generates a clean text-based dashboard in the corner of your chart window.
- It creates a header to identify the different timeframes.
- It places individual status labels for each timeframe side-by-side.
- Each label changes color dynamically based on the trend logic described above (Green for up, Red for down).
Summary for the User
In simple terms, this tool acts as a "Trend Radar." It tells you what the momentum looks like across the entire market spectrum—from the fast-moving 1-minute fluctuations to the slow-moving daily trends—and summarizes it into a small, color-coded visual display on your main screen.
//+------------------------------------------------------------------+
//| _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();
Obj0001 = "Numbers" + LabelTime ;
if ( Show_Heading) {
if (Corner_of_Chart_RIGHT_TOP == true)
{
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 ********************
//SAR Signals
double SAR_M1 = iSAR(Symbol(),1,SAR_Step,SAR_Max,0);
//double SAR_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 SAR_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 SAR_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 SAR_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 SAR_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 SAR_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 SAR_d1 = iMA(Symbol(),1440,MA_Slow,0,MA_MODE,MA_PRICE_TYPE,0);
// double SAR_W1 = iMA(Symbol(),10080,MA_Fast,0,MA_MODE,MA_PRICE_TYPE,0);
// double SAR_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; }
Obj0002 = "SignalSARM1t" + 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);
Obj0003 = "SignalSARM1" + 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);
Obj0004 = "SignalSARM5" + 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);
Obj0005 = "SignalSARM15" + 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);
Obj0006 = "SignalSARM30" + 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);
Obj0007 = "SignalSARM60" + 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);
Obj0008 = "SignalSARM240" + 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);
Obj0009 = "SignalSARM1440" + 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();
//----
return(0);
}
void deleteObject()
{
ObjectDelete(Obj0001);
ObjectDelete(Obj0002);
ObjectDelete(Obj0003);
ObjectDelete(Obj0004);
ObjectDelete(Obj0005);
ObjectDelete(Obj0006);
ObjectDelete(Obj0007);
ObjectDelete(Obj0008);
ObjectDelete(Obj0009);
}
Comments