Help with MTF condition

Pelonsax

Pelonsax

Active member
VIP
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?
...in which case, I want the default AGG to be Aggregation.FIVE _MIN;
 
BenTen

BenTen

Administrative
Staff
VIP
This is possible; I remember seeing a few scripts with this sort of condition. I just don't know where they are now. Will dig around.
 
Pelonsax

Pelonsax

Active member
VIP
Thanks Ben. Might be a moot point now that I got VFE to work on any time frame. But it still might be useful to know.
 
MerryDay

MerryDay

Member
VIP
@Pelonsax

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...
 
Thread starter Similar threads Forum Replies Date
B Help me create Schaff MTF version Questions 2
H SuperTrend MTF...HELP! Questions 2
T Help me Add Chart Bubble on previous candle Questions 3
L Need help with Volume index indicator Questions 9
VladMad Need help with array variables Questions 1

Similar threads

Top