How Can i Filter Range Market in This Indicator

 

Hey Guys 

i Just Tried To Cconvert an indicator From PineScript to Mql4 and i made this indicator

but now i want to add some sideways market filter to it for more accurate signals

i found some indicators called " Slope Direction "

is there any way to tell this signal indicator to " Do Not Show Signal While this Slope Direction Indicator's Angle is Less than 30 Degrees " ,

or Maybe it Shows the signals only in the Way of Trend ? Forexample Imagine 

market is in an up Trend and the indicator is showing Sell Signal , i want to filter that Sell Signals ,

i'd Gladly Apperciate if u help me to filter Range market or signals Against the Whole Trend , it Doesnt Matter how to filter , ! thanks

here it is my indicator : 

 

Businext:

is there any way to tell this signal indicator to " Do Not Show Signal While this Slope Direction Indicator's Angle is Less than 30 Degrees " ,

or Maybe it Shows the signals only in the Way of Trend ?

i'd Gladly Apperciate if u help me

  1. Can't be done.
    1. There is no angle from 2 anchor points. An angle requires distance divided by distance; a unit-less number. A chart has price and time. What is the angle of going 30 miles in 45 minutes? Meaningless!

    2. You can get the slope from a trendline: m=ΔPrice÷ΔTime. Changing the price scale, bar width, or window size, changes the apparent angle, the slope is constant. Angle is meaningless.

    3. You can create an angled line using one point and setting the angle (Object Properties - Objects Constants - Standard Constants, Enumerations and Structures - MQL4 Reference.) The line is drawn that angle in pixels. Changing the axes scales does NOT change the angle (and thus is meaningless.)

    4. If you insist, take the two price/time coordinates, convert them to pixel coordinates and then to apparent angle with arctan.
                How to get the angle of a trendline and place a text object to it? - Trend Indicators - MQL4 programming forum - Page 2

  2. Your indicator only shows uptrends.
          if(B1[i]>B1[i+1]) B2[i]=B1[i];
          else B2[i]=EMPTY_VALUE;
    
    So code it to do that.

    Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.

    You should encapsulate your iCustom calls to make your code self-documenting.
              Detailed explanation of iCustom - MQL4 programming forum #33 2017.05.23

  3. Please post only in English on this forum.
              Please don't write ur - it's "you are" or "your" - MQL4 programming forum 2014.03.04

    Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

 

William Roeder:

  1. Can't be done.
    1. There is no angle from 2 anchor points. An angle requires distance divided by distance; a unit-less number. A chart has price and time. What is the angle of going 30 miles in 45 minutes? Meaningless!

    2. You can get the slope from a trendline: m=ΔPrice÷ΔTime. Changing the price scale, bar width, or window size, changes the apparent angle, the slope is constant. Angle is meaningless.

    3. You can create an angled line using one point and setting the angle (Object Properties - Objects Constants - Standard Constants, Enumerations and Structures - MQL4 Reference.) The line is drawn that angle in pixels. Changing the axes scales does NOT change the angle (and thus is meaningless.)

    4. If you insist, take the two price/time coordinates, convert them to pixel coordinates and then to apparent angle with arctan.
                How to get the angle of a trendline and place a text object to it? - Trend Indicators - MQL4 programming forum - Page 2

  2. Your indicator only shows uptrends. So code it to do that.

    Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.

    You should encapsulate your iCustom calls to make your code self-documenting.
              Detailed explanation of iCustom - MQL4 programming forum #33 2017.05.23

  3. Please post only in English on this forum.
              Please don't write ur - it's "you are" or "your" - MQL4 programming forum 2014.03.04

    Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.1


1- The Question is Am i Able To have some Kind Of Straight Moving Average ? 

2- second Question is Am i Able To Calculate the Angle of a Moving Average just like i calculate angle of a trendline ?

so if i can do this i can use this Slope to identify the Market is Trending Or its Range!

 
Businext:

1- The Question is Am i Able To have some Kind Of Straight Moving Average ? 

2- second Question is Am i Able To Calculate the Angle of a Moving Average just like i calculate angle of a trendline ?

  1. Straight Moving is a contradiction of terms.
  2. What part of #1.1 did you not understand?
Reason: