Re: Coding Help

1144
Hello everyone,

I'm new coding Custom Indicators, I coded this days ago, it's kind of simple.
It's funtion is to display the High and Lows of different Timeframes (Daily, Weekly, Monthly and Yearly)

But I can't make it work the way I want, i'm trying to figure out how to:
- Displaying only the input specified on each time TF
- Drawing the lines as TrendLines (with Right-Ray) from when it got the High/Low price (Not as Horizontal lines as I coded)
- Calculating the past Years High/Low's
- Deleting the lines that shares the same price, keeping the higher timeframe one
- And finally, a datetime option for the indicator to calculate past Timeframes H/L from that specific Day.

Hope is not too much to ask, been researching on how to do it myself but no luck. Any coding tips is apreciated.

-Syllyon

Re: Coding Help

1145
JNS247 wrote: Wed Jul 15, 2020 8:32 pm Hello Banzai

It is doing my head in, at one stage I managed to get the button on the chart, now it is nowhere to be found.
Like a challange but not getting this to work
I have used the day_seperator_2_2 code, one difference I noticed was the init and OnInit the start functions are the same and so the deinit, reading the MQL Help reference is just blowing my mind.
it compile without errors
I'll leave it to the pros.
When you have time thanks in advance.
JNS
It doesn't work for me either.
I'm going to ask Mario to do this one.
Hang on.


Re: Coding Help

1147
am7609 wrote: Tue Aug 04, 2020 6:37 am Can someone please tell me why does this problem happen
it's zerolag dema from mladen
when I use iDema in just one loop everything is OK but when I use the iDema in the second loop it also changes the value of val in the first loop .


If you are wanting a zerolag dema you already have that in the first loop.

Code: Select all

for(i=limit; i>=0; i--)
      {
         double dema1 = iDema(Close[i],Length,i,Bars,0);
         double dema2 = iDema(dema1 ,Length,i,Bars,1);
         val[i] = 2.0*dema1-dema2;
      }

Re: Coding Help

1148
mrtools wrote: Tue Aug 04, 2020 7:19 am

If you are wanting a zerolag dema you already have that in the first loop.

Code: Select all

for(i=limit; i>=0; i--)
      {
         double dema1 = iDema(Close[i],Length,i,Bars,0);
         double dema2 = iDema(dema1 ,Length,i,Bars,1);
         val[i] = 2.0*dema1-dema2;
      }
No I want to use it to smooth other variables too, not just price.this code is just for illustration of my problem in another code. when I use zerolag dema more than once in my code to smooth other variables the value of first variable in this case &val also changes.
By the way It works just fine till the price changes


Who is online

Users browsing this forum: No registered users and 18 guests