stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Same LWMA(240) 1H values in all Lower TFs ?
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3854
Page 1 of 1
Author:  rivelrivella [ Wed Oct 01, 2014 10:53 pm ]
Post subject:  Same LWMA(240) 1H values in all Lower TFs ?

Hi,

Could anyone help me how to code IMA formula to give me LWMA (240 periods) for 1 Hour Period, whatever Lower Time Frame is ? (5M, 15M, 30M).

So if I have 15min Chart, I'd like to have the same value of LWMA240 for 9H15, 9H30, 9H45 or 10H
And if I have the 30 min chart, I'd like to have the same value of LWMA240 for 9H30 or 10H

So when changing TF chart (Less than 1H) I'd like to have the same LWMA curve.

Thanks
Author:  milanese [ Wed Oct 01, 2014 11:24 pm ]
Post subject:  Same LWMA(240) 1H values in all Lower TFs ?

rivelrivella ยป Wed Oct 01, 2014 10:53 pm wrote:Hi,

Could anyone help me how to code IMA formula to give me LWMA (240 periods) for 1 Hour Period, whatever Lower Time Frame is ? (5M, 15M, 30M).

So if I have 15min Chart, I'd like to have the same value of LWMA240 for 9H15, 9H30, 9H45 or 10H
And if I have the 30 min chart, I'd like to have the same value of LWMA240 for 9H30 or 10H

So when changing TF chart (Less than 1H) I'd like to have the same LWMA curve.

Thanks
Hi,

you can code it in the same way I did it with the MTF stoch in 10.7 stoch indi..

Code: Select all

// Plot defined timeframe on to current timeframe   
   ArrayCopySeries(TimeArray1,MODE_TIME,Symbol(),PERIOD_H1);
 limit=Bars-counted_bars+PERIOD_H1/Period();
for(i=0,y1=0;i<limit;i++)

     {
      if(Time[i]<TimeArray1[y1]) y1++;
      MA_value=iMA(symbol,PERIOD_H1,240,0,MODE_LWMA,PRICE_CLOSE,y1);
     
}
Cheers :)


Tommaso
Author:  Lowphat [ Thu Oct 02, 2014 1:50 am ]
Post subject:  Same LWMA(240) 1H values in all Lower TFs ?

if your using a fixed number u can also probably do something like

init
if (period == 1h) MAPeriod = 240
if (period == 30m) MAPeriod = 480
if (period == 15m) MAPeriod = 960
if (period == 5m) MAPeriod = 2880
if (period == 240m) MAPeriod = 60
if (period == 1440m MAPeriod = 10
if period> a day MAPeriod = 1
etc...
that way your line wont be aliased if your looking at it visually
Author:  rivelrivella [ Mon Oct 06, 2014 2:02 pm ]
Post subject:  Same LWMA(240) 1H values in all Lower TFs ?

Thank you a lot Tommaso, for your help.
All times are UTC Page 1 of 1