Hi, if anyone is kind enough to look at this and tell me what I am doing wrong. I want to see the MACD condition as bars for M15 but on the M5 so it can change 3 times per M15 bar. I don't want it to change color after the bar is closed. My code in the Start() section simply calculates the current bar and then moves to history on bar change but it all disappears when I close the chart so I want to calculate prior bars on Init(). The code I added to Init() seems right to my thinking but all my bars are green so it is not calculating correctly. 'i' is the M5 bar and 'j' is the M15 bar. I add the Close[i] prices to the ClosedPrice array and then calculate the MACD based on current close and prior M15 'j' closes. Thanks if you can help.
Only the Init() section is the problem.
Only the Init() section is the problem.
Attached File(s)
MACDBars-static.mq4
7 KB
|
1,193 downloads