PDA

View Full Version : HH & HL Indicator


TraderGuy
02-17-2008, 08:43 AM
I used this indicator with TS and MultiCharts and found it useful. The indicator marks the progression of swing highs and lows with HH, LH, etc. Also marks double tops and bottoms.

It has four inputs:

DTDBStrength - higher numbers loosen the criteria for marking DT & DB
Lookback - same as swing indicator, bars to lookback for the swings
Strength - same as swing, strength of swings
TextOffset - higher numbers move the text away from the bars

Indicator and Chart attached.

Regards,
Guy

zoltran
02-17-2008, 03:02 PM
Thanks Guy !

einstein
02-17-2008, 03:53 PM
I cannot import this into v 6.0. Perhaps it works in 6.5 but there is another indicator I use already which won't import into 6.5. Any suggestions?

art cole
02-17-2008, 04:37 PM
Guy,

Very nice! Thank you

Ninja B
06-02-2008, 07:25 AM
Great indicator. very useful. Thank you very much

calibri
06-02-2008, 01:27 PM
great work, thx a lot

capstone
06-18-2008, 05:47 AM
Good indicator ...thanks vm.

My question is can the red and green marks be made into arrows ie: red and green arrows instead of naming the points ?

Thanks in advance for your reply

mason
06-18-2008, 09:43 PM
Enjoy it.

If you still don't like it try DrawDot(), DrawDiamond() etc

capstone
06-19-2008, 08:48 AM
Appreciate it !

Many thanks :)

NickA
06-26-2008, 02:26 AM
As I am not so proficient at Ninjascript might I suggest a couple of improvements if anyone is feeling up to it?

1st) Rather than 'strength' it would be great to have a left strength and right strength. i.e. number of bars to the left and number of the bars to the right that are considered for a swing to be recorded. I think that this is a limitation of ninjas inbuilt swing function that I guess this code uses.

2) for dtstrength allow a % of the swing to be given. If it is a 20 tick swing 2 ticks might be good but if it is a 5 tick swing it probably isn't. 10% would catch that.

Hopefully one of these days I will be more proficient at Ninja Script but for now thanks for your consideration anyway :)

DragonTaurus
10-04-2008, 07:08 PM
Anyone guide/help with turning this indicator into a Strategy?

- Go long at green arrow.
- Short at red arrows.
- Add to position at 2nd arrow in a series.
-- (if in a green arrow position another green pops before a red, add)
-- (vice versa, upon a 2nd red before a green, add to short position)

(changing color of arrows to opposite current values would also be great [visually easier]. I tried by editing the file and just changing 'green' to 'red' but it didn't work for me.)

thanks!

veggen
11-03-2008, 03:48 PM
Anybody have this indicator in EL- file??

ctrlbrk
11-22-2008, 09:43 PM
I am trying to convert this for use in a strategy, by having the indicator return a value (0=up arrow, 1=down arrow).

However, when I reference the indicator from my strategy, the only thing being returned is the price of the bar and not the '0' or '1'.

I have written many strategies but never an indicator, so I am sure this is a simple mistake/fix, help is appreciated.

Here is a snippet of code from the indicator:

if (curhigh > prevhigh)
{
Value.Set(1); // 0=up, 1=down
DrawArrowDown("AD1"+CurrentBar,true,barsback, High[barsback] + toffset, Color.Green);
// DrawText("HH"+CurrentBar,"HH",barsback, High[barsback] + toffset, Color.Green);
}


TIA
Mike

NinjaTrader_Josh
11-23-2008, 12:32 PM
ctrlbrk,

You need to expose the DataSeries and then access it from accordingly. If you have not set a value for the current bar you are trying to access you will get the default value returned which is the price of the bar instead of 0 and 1. Please make sure you have set a value to this bar before trying to access it.

ctrlbrk
11-23-2008, 02:48 PM
Josh,

Isn't that what Value.Set does? Set a value? Above in red, I set it to either a 0 or 1 accordingly.

As for exposing the DataSeries... throw me a bone please? (example code)

I looked at several different indicators to try and figure this out, but none operate this way that I could find -- they all return a price, not a true/false or 0/1.

Mike

TAJTrades
11-23-2008, 03:56 PM
http://www.ninjatrader-support2.com/vb/showthread.php?t=4991

There is your bone...

ctrlbrk
11-23-2008, 04:02 PM
Awesome thanks, I will take a look.

ctrlbrk
11-23-2008, 06:07 PM
Sorry I am just not getting this.

The issue seems to be it only returns the true/false for the current bar. I need it to stay 'true' until it becomes 'false', and vice versa, so if 4 bars ago it was 'true' then it needs to be true 3 bars ago, 2 bars ago, 1 bar ago.. until it becomes 'false'.

Hope that makes sense.

I've attached the code.

TAJTrades
11-24-2008, 04:42 AM
I believe there are two files in the SamplBoolSeries Example:

1) SampleBoolSeries : Indicator that creates the BoolSeries
2) SampleBoolSeriesStrategy : Strategy that retrieves the values created in the indicator.

Every bar will need to be evaluated to true or false in the indicator so you will need to write your code to accomplish this. Then you can go back and retrieve the value (true/false) from any bar for use in other Indicators or Strategies.

NinjaTrader_Josh
11-24-2008, 07:10 AM
As long as you do not override your .Set()s it will remain whatever you set it to. BoolSeries, DataSeries, etc. all store the last value set into it for the bar index.