I should say I am a beginner with ninjaScript.
I am trying to make use of swing indicator. My code is very simple:
protected override void OnBarUpdate()
{
// Prints the high price of the most recent swing high
Print("The high of the swing bar is " + High[Math.Max(0, Swing(5).SwingHighBar(0, 1, 5))]);
}
And my problem(s) are simple I guess but I couldn't solve them. So
- How do I stop this code from populating the whole output window.? I want just a few values.
- If there are roughly 120 bars on the chart, I would like this indicator to return lets say 3-4 highs which happened within a range of last 80 bars. How would I do this?
- What is the most efficient way of printing the output of the code into the output window. I currently do this: a) compile the indicator b) clear the output window c) go to chart window d) press F5 to populate the output window. I there a smarter way?
Regards,
Ionaz
Comment