1MINSCALP
Download scriptThis tool is designed to identify specific entry points in the financial markets by analyzing changes in price boundaries. Rather than just looking at the current price, it monitors a specialized set of trend envelopes to detect when the market "breaks" or shifts its structural limits.
How the Logic Works
The script functions by comparing the current state of the market's trend boundaries against their previous positions. It specifically looks for "crosses"—moments where a boundary moves from one side of a specific numerical threshold to another.
Here is the step-by-step breakdown of the logic:
- Trend Envelope Monitoring: The tool continuously tracks two distinct types of trend lines (upper and lower boundaries). It looks back at these lines over a set period to understand the current momentum.
- Detection of Breaks: Instead of following every small move, the script waits for a significant shift. It compares the value of these boundaries from one candle ago to the value two candles ago.
- The Trigger Mechanism:
- Bullish Signal: If the lower boundary drops below a specific designated level (moving from above to below), the script identifies this as a potential signal and places a "Buy" marker (Lime arrow) just below the current price.
- Bearish Signal: If the upper boundary drops below that same designated level (moving from above to below), the script identifies this as a potential shift and places a "Sell" marker (Red arrow) just above the current price.
- Visual Output: The results are displayed directly on your trading chart as arrows, allowing you to see exactly where the trend boundaries crossed the required threshold, highlighting potential areas of interest for your trading strategy.
Key Features for the User
- Historical Analysis: The tool can be configured to look back over a large amount of historical data (up to 5,000 bars) to ensure you can see past signals clearly.
- Multi-Timeframe Awareness: It is designed to interact with "Trend Envelope" data, ensuring that the signals are grounded in broader trend movements rather than just random price noise.
- Clean Visuals: By using arrows on the chart, the script keeps your workspace uncluttered while providing immediate visual confirmation of the logic's triggers.
//+------------------------------------------------------------------+
//| ADX Crossing.mq4
//| Amir
//+------------------------------------------------------------------+
#property copyright "Author - Amir"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
//---- input parameters
extern int timeframe=15;
extern int CountBars=5000;
double TEStopUPb4, TEStopDNb4, TEStopUP, TEStopDN;
//---- buffers
double val1[];
double val2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,108);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,108);
SetIndexBuffer(0,val1);
SetIndexBuffer(1,val2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2 |
//+------------------------------------------------------------------+
int start()
{
if (CountBars>=Bars) CountBars=Bars;
SetIndexDrawBegin(0,Bars-CountBars);
SetIndexDrawBegin(1,Bars-CountBars);
int i,shift,counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- initial zero
if(counted_bars<1)
{
for(i=1;i<=CountBars;i++) val1[CountBars-i]=0.0;
for(i=1;i<=CountBars;i++) val2[CountBars-i]=0.0;
}
for (shift = CountBars; shift>=0; shift--)
{
TEStopUPb4=iCustom(Symbol(),0,"#MTF_TrendEnvelopes",15,0,shift+2);
TEStopDNb4=iCustom(Symbol(),0,"#MTF_TrendEnvelopes",15,1,shift+2);
TEStopUP= iCustom(Symbol(),0,"#MTF_TrendEnvelopes",15,0,shift+1);
TEStopDN= iCustom(Symbol(),0,"#MTF_TrendEnvelopes",15,1,shift+1);
Comment(TEStopUP," ", TEStopDN);
if (TEStopUP < 20000 && TEStopUPb4 >20000)
{
val1[shift]=Low[shift]-5*Point;
}
if (TEStopDN <20000 && TEStopDNb4 >20000)
{
val2[shift]=High[shift]+5*Point;
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments