Hi,
I have a question that I hope I can get some help with.
I've used some other automated trading platforms before, and if I used minute bar chart but my trading signal depended on day/week highest/lowest line, I should use a built-in function to convert the time frame of the bar. The aim of this is to trade intraday.
I don't know whether I need to write some functions to reach it with multicharts. Does multicharts has a more convenient way to do that?
Thank you
Calculate week/day highest/lowest on minute bar chart [SOLVED]
- JoshM
- Posts: 2196
- Joined: May 20 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
I think you're overthinking it. Sure, you can write it in a function, but multiple functions or converting bars are not needed if you just want to track the daily (or weekly) high or low.I've used some other automated trading platforms before, and if I used minute bar chart but my trading signal depended on day/week highest/lowest line, I should use a built-in function to convert the time frame of the bar. The aim of this is to trade intraday.
I don't know whether I need to write some functions to reach it with multicharts. Does multicharts has a more convenient way to do that?
In pseudo-code, you could try something like:
Code: Select all
Variables:
weeklyHigh(0),
weeklyLow(99999);
// Reset variables on monday
if (DayOfWeek(Date) = 1 {Monday} ) begin
weeklyHigh = 0;
weeklyLow = 999999;
end;
weeklyHigh = MaxList(weeklyHigh, High);
weeklyLow = MinList(weeklyLow, Low);
Hello JoshM, your reply inspired me greatly, thank you. Your code indicates weekly high and low clearly.
Further, if I want to retreat a few weeks/days further in every different day, for example, if today is Wednesday, then I want to calculate the high/low from last Wednesday or the Wednesday a few weeks ago. Still using minute bar chart.
Will the code become more complicated?
Thank you!
Further, if I want to retreat a few weeks/days further in every different day, for example, if today is Wednesday, then I want to calculate the high/low from last Wednesday or the Wednesday a few weeks ago. Still using minute bar chart.
Will the code become more complicated?
Thank you!