Re: MT4 Indicator requests and ideas

3692
MX01 wrote: Thu Jul 05, 2018 4:47 pm Hey there mrtools or any other experts here :)

Does this kind of pivot points for MT4 exist? I have it only for ThinkOrSwim but can't find for MT4.

See the screenshot with yellow dots. The yellow dots appear after the fact, so they're not real time entry signals of course. But it draws previous pivot points. In this case it's on M1 chart and set to "num bars 5".

Here is also the TOS code of the indicator. Not sure if some coding expert can translate it for MT4. And if such a pivot points indi for MT4 exists already please attach here and I thank you very much!

Screen Shot 2018-07-05 at 08.43.58.png

Code: Select all

input numBars = 5; 
input showLines = yes; 
input showValues = yes; 
input showBarNumbers = no; 
input TrendResistanceStart = 0; 
input TrendResistanceEnd = 0; 
input TrendSupportStart = 0; 
input TrendSupportEnd = 0; 

def UserSetResistance = TrendResistanceStart > 0 and TrendResistanceEnd > 0; 
def UserSetSupport = TrendSupportStart > 0 and TrendSupportEnd > 0; 
def currentHigh = high; 
def currentLow = low; 
def currentBar = BarNumber(); 
def PH; 
def PL; 
def isHigherThanNextBars = fold i = 1 to numBars + 1 with p = 1 
while p do currentHigh > GetValue(high, -i); 
PH = if UserSetResistance and ( currentBar == TrendResistanceStart or currentBar == TrendResistanceEnd ) then currentHigh else if !UserSetResistance and (currentBar > numBars and currentHigh == Highest(currentHigh, numBars) and isHigherThanNextBars) then currentHigh else Double.NaN; 
def isLowerThanNextBars = fold j = 1 to numBars + 1 with q = 1 
while q do currentLow < GetValue(low, -j); 
PL = if UserSetSupport and ( currentBar == TrendSupportStart or currentBar == TrendSupportEnd ) then currentLow else if !UserSetSupport and (currentBar > numBars and currentLow == Lowest(currentLow, numBars) and isLowerThanNextBars) then currentLow else Double.NaN; 
rec PHBar = if UserSetResistance then TrendResistanceEnd else if !IsNaN(PH) then currentBar else PHBar[1]; 
rec PLBar = if UserSetSupport then TrendSupportEnd else if !IsNaN(PL) then currentBar else PLBar[1]; 
rec PHL = if !IsNaN(PH) then PH else PHL[1]; 
rec priorPHBar = if UserSetResistance then TrendResistanceStart else if PHL != PHL[1] then PHBar[1] else priorPHBar[1];
rec PLL = if !IsNaN(PL) then PL else PLL[1]; 
rec priorPLBar = if UserSetSupport then TrendSupportStart else if PLL != PLL[1] then PLBar[1] else priorPLBar[1]; 
def isFinalTwoHighPivots = currentBar >= HighestAll(priorPHBar); 
def isFinalTwoLowPivots = currentBar >= HighestAll(priorPLBar); 
def ResistanceFinishOffset = if isFinalTwoHighPivots then currentBar - PHBar else 0; 
def ResistanceStartOffset = if isFinalTwoHighPivots then currentBar - priorPHBar else 0; 
def ResistanceSlope = (GetValue(PH, ResistanceFinishOffset) - GetValue(PH, ResistanceStartOffset)) / (PHBar - priorPHBar); 
def SupportFinishOffset = if isFinalTwoLowPivots then currentBar - PLBar else 0; 
def SupportStartOffset = if isFinalTwoLowPivots then currentBar - priorPLBar else 0; 
def SupportSlope = (GetValue(PL, SupportFinishOffset) - GetValue(PL, SupportStartOffset)) / (PLBar - priorPLBar); 
rec ResistanceExtend = if currentBar == HighestAll(PHBar) then 1 else ResistanceExtend[1]; 
rec SupportExtend = if currentBar == HighestAll(PLBar) then 1 else SupportExtend[1]; 

def pivotHigh = if 
#isFinalTwoHighPivots 
ph>0 then PH else Double.NaN; 

def pivotLow = if 
#isFinalTwoLowPivots 
pl>0 then PL else Double.NaN; 

plot PivotDot = if !IsNaN(pivotHigh) then pivotHigh else if !IsNaN(pivotLow) then pivotLow else Double.NaN; 
PivotDot.SetDefaultColor(COLOR.YELLOW); 
PivotDot.SetPaintingStrategy(PaintingStrategy.POINTS); 
PivotDot.SetLineWeight(5);
Want to say that is similar to fractals.

Re: MT4 Indicator requests and ideas

3695
rijay wrote: Fri Jul 06, 2018 4:03 pm


it seems to be working with your suggestion, thanks
Don't know why the user should hardcode here a MaxValue.

I have commented out the (extern double MaxValue... line) and added this in global space

Code: Select all

double window_top,window_bottom;
then added this in init() section

Code: Select all

window_top=WindowPriceMax()+iATR(Symbol(),PERIOD_D1,5,0);
window_bottom=MathMax(0,WindowPriceMin()-iATR(Symbol(),PERIOD_D1,5,0));
and changed the ObjectCreate from

Code: Select all

ObjectCreate(name,OBJ_RECTANGLE,0,times[i+1],0,lastTime,MaxValue);
to

Code: Select all

ObjectCreate(name,OBJ_RECTANGLE,0,times[i+1],window_bottom,lastTime,window_top);

I have added also a "ShowBadAngleZoneInMainChart" input setting. Whenever the angle is smaller than AngleLevel a zone is marked in the main chart (I want to trade only when we have a good slope/angle for example)...

Don't know if this is useful for someone else but I add my changed file here as attachement.
These users thanked the author Jagg for the post (total 2):
moey_dw, Mendel


Re: MT4 Indicator requests and ideas

3696
Jagg wrote: Fri Jul 06, 2018 6:02 pm

Don't know why the user should hardcode here a MaxValue.

I have commented out the (extern double MaxValue... line) and added this in global space

Code: Select all

double window_top,window_bottom;
then added this in init() section

Code: Select all

window_top=WindowPriceMax()+iATR(Symbol(),PERIOD_D1,5,0);
window_bottom=MathMax(0,WindowPriceMin()-iATR(Symbol(),PERIOD_D1,5,0));
and changed the ObjectCreate from

Code: Select all

ObjectCreate(name,OBJ_RECTANGLE,0,times[i+1],0,lastTime,MaxValue);
to

Code: Select all

ObjectCreate(name,OBJ_RECTANGLE,0,times[i+1],window_bottom,lastTime,window_top);

I have added also a "ShowBadAngleZoneInMainChart" input setting. Whenever the angle is smaller than AngleLevel a zone is marked in the main chart (I want to trade only when we have a good slope/angle for example)...

Don't know if this is useful for someone else but I add my changed file here as attachement.
looks interesting

Re: MT4 Indicator requests and ideas

3700
I really want to appreciat you sir for your effort in helping traders. I just joined this forum yesterday.
Please i have two indicators i want you to help me put together to form a trading system.
one is what i downloaded from here you made it and is very great because it does not repaint.
The second i got it elswhere but if this two are put together it can form a nice trading system.

First sir i want you to check if the ATB SNIPER repaints. if it does please make it a non repainted.
The arrow indicator i got from you does not repaint.
Please combine the two indicators to give an alert whenever new triangle starts forming on any time frame on the listed currency pairs.
As the triangle is forming I want to be receiving alert any time arrow appers.
PLEASE ADD EMAIL NOTIFICATION, PUSH NOTIFICATION, MOBILE AND TEXT ALERT THE THE ENTIRE SYSTEM.
THANK YOU SIR. I AWAIT YOUR RESPONSE SIR.


Who is online

Users browsing this forum: Abdi, Bing [Bot], boytoy, ChatGPT [Bot], Krunal Gajjar, LittleCaro, ssscary, thomdel, Yandex [Bot] and 106 guests