Help with MTF condition


Active member
Does anybody know how to add a condition that sets the aggregation to whatever the time frame the chart is set to UNLESS that time frame is LESS THAN 5 minutes? which case, I want the default AGG to be Aggregation.FIVE _MIN;


Well-known member

I am so not a programmer. I just play around until I get the results I want. Soooo... take this with 10grains of salt.

I do something similar to this:
def Agg_calc = GetAggregationPeriod();
def Agg2 = if Agg_calc <= AggregationPeriod.five_min then AggregationPeriod.five_min else Agg_calc ;

PS: I look to default to higher time frames so the above snippet is not exactly what I use and is untested.
It is just some food for thought...

Similar threads