Traders Laboratory - View Single Post - H/L Intrabar Indicator
View Single Post
  #5 (permalink)  
Old 08-20-2007, 09:15 AM
trader273's Avatar
trader273 trader273 is offline
trader273 is chilling in Quahog

 
Join Date: Oct 2006
Posts: 128
Thanks: 2
Thanked 16 Times in 12 Posts
Re: H/L Intrabar Indicator

Jonick,

Here was I was able to come up with. It plots the High/Low/ and Range. I do not know how to plot the text up above the chart like your example, but toy around with this one and you should be able to get it how you like. Also, I am in no way a coder but I was able to search around and piece together what I was looking for. I'm sure there are better ways to get this done, but this is what I was able to build. All I ask is that if you come across someone who needs something that you got you help them out, kind of a pay-it-forward idea. I built this in MC so I'm sure if everything will compile correctly, but the things that don't should be an easy fix.

inputs: HL_OFFSET(3), DECIMALS(0), Text_Attr(1), HIGH_Text_Color(DARKGREEN), LOW_Text_Color(DARKRED), RAN_TEXT_COLOR(darkblue), HIGH_TEXT("H:"), LOW_TEXT("L: "), RAN_TEXT("RANGE: "), Texts("Calibri"), Texts_Size(12), LEFT_RIGHT(" "); vars: HIGH_TL( 0 ), LOW_TL(0), Hid(0), Lid(0), RAN(0), RID(0), vDELETE(0); If LastBarOnChart then begin RAN=absvalue(HIGH-LOW); HIGH_TL = TL_New(date, time, high, date, time, high); LOW_TL= TL_New(date, time, low, date, time, low); Hid=text_new(date,time,high+HL_OFFSET,LEFT_RIGHT+HIGH_TEXT+(NumToStr(HIGH,DECIMALS))); text_setstyle(Hid,0,1); text_setfontname(Hid,texts); text_setsize(Hid,texts_size); text_setcolor(Hid,HIGH_text_color); text_setattribute(Hid,Text_Attr,true); Lid=text_new(date,time,low-HL_OFFSET,LEFT_RIGHT+LOW_TEXT+NumToStr(LOW,DECIMALS)); text_setstyle(Lid,0,0); text_setfontname(Lid,texts); text_setsize(Lid,texts_size); text_setcolor(Lid,LOW_text_color); text_setattribute(Lid,Text_Attr,true); Rid=text_new(date,time,OPEN,LEFT_RIGHT+RAN_TEXT+NumToStr(RAN,DECIMALS)); text_setstyle(Rid,0,0); text_setfontname(Rid,texts); text_setsize(Rid,texts_size); text_setcolor(Rid,RAN_text_color); text_setattribute(Rid,Text_Attr,true); if HIGH_TL[1] > 0 AND HIGH_TL<> HIGH_TL[1] then vDELETE= TL_Delete(HIGH_TL[1]); if LOW_TL[1] > 0 AND LOW_TL <> LOW_TL[1] then vDELETE = TL_Delete(LOW_TL[1]); if HIGH_TL[1] > 0 AND HIGH_TL<> HIGH_TL[1] then vDELETE = text_delete(Hid[1]); if LOW_TL[1] > 0 AND LOW_TL <> LOW_TL[1] then vDELETE = text_delete(Lid[1]); if LOW_TL[1] > 0 AND LOW_TL <> LOW_TL[1] then vDELETE = TEXT_Delete(RID[1]); end;
Attached Images
File Type: png H-L-R.png (3.6 KB, 36 views)

Reply With Quote