Advertisement
saisri

ultimate volitility expert

Dec 20th, 2013
2,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.56 KB | None | 0 0
  1. _SECTION_BEGIN("Price");
  2.  
  3. SetChartOptions(0,chartShowArrows|chartShowDates);
  4. SetChartBkColor(ParamColor("bkcolor",ColorRGB(0,0, 0)));
  5. //SetTradeDelays(1,1,1,1);
  6. SetPositionSize(100,spsShares);
  7. _SECTION_END();
  8.  
  9. NDays=Param("Number of Days",10,1,50,1);
  10. DayC=TimeFrameGetPrice("C",inDaily,-1);
  11. NDaysDHLAvg=0;
  12. for(i=1;i<=NDays;i++)
  13. {
  14. DayH=TimeFrameGetPrice("H",inDaily,-i);
  15. DayL=TimeFrameGetPrice("L",inDaily,-i);
  16. NDaysDHLAvg=NDaysDHLAvg+(DayH-DayL);
  17. }
  18. NDaysDHLAvg=NDaysDHLAvg/NDays;
  19.  
  20. ADM= NDaysDHLAvg; // Average Day Moment
  21.  
  22. // Dynamic Levels//----------Majer Support Resistent Zones---------------------------------------------------
  23.  
  24. DayH = TimeFrameGetPrice("H", inDaily, -1); DayHI = LastValue (DayH,1); // yesterdays high
  25. DayL = TimeFrameGetPrice("L", inDaily, -1); DayLI = LastValue (DayL,1); // yesterdays low
  26. DayC = TimeFrameGetPrice("C", inDaily, -1); DayCI = LastValue (DayC,1); // yesterdays close
  27. DayO = TimeFrameGetPrice("O", inDaily); DayOI = LastValue (DayO,1); // current day open
  28. WeekH= TimeFrameGetPrice("H", inWeekly, 0); WeekHI = LastValue (WeekH,1); // This Week high
  29. WeekL= TimeFrameGetPrice("L", inWeekly, 0); WeekLI = LastValue (WeekL,1); // This Week low
  30. MonthH= TimeFrameGetPrice("H", inMonthly, 0); MonthHI = LastValue (MonthH,1); // This Month high
  31. MonthL= TimeFrameGetPrice("L", inMonthly, 0); MonthLI = LastValue (MonthL,1); // This Month low
  32. LWeekH= TimeFrameGetPrice("H", inWeekly, -1); LWeekHI = LastValue (LWeekH,1); // One Week before high
  33. LWeekL= TimeFrameGetPrice("L", inWeekly, -1); LWeekLI = LastValue (LWeekL,1); // One Week before low
  34. LMonthH= TimeFrameGetPrice("H", inMonthly, -1); LMonthHI = LastValue (LMonthH,1); // One Month before high
  35. LMonthL= TimeFrameGetPrice("L", inMonthly, -1); LMonthLI = LastValue (LMonthL,1); // One Month before low
  36. L1WeekH= TimeFrameGetPrice("H", inWeekly, -2); L1WeekHI = LastValue (L1WeekH,1); // Two Week before high
  37. L1WeekL= TimeFrameGetPrice("L", inWeekly, -2); L1WeekLI = LastValue (L1WeekL,1); // Two Week before low
  38. L1MonthH= TimeFrameGetPrice("H", inMonthly, -2); L1MonthHI = LastValue (L1MonthH,1); // Two Month before high
  39. L1MonthL= TimeFrameGetPrice("L", inMonthly, -2); L1MonthLI = LastValue (L1MonthL,1); // Two Month before low
  40. L2WeekH= TimeFrameGetPrice("H", inWeekly, -3); L2WeekHI = LastValue (L2WeekH,1); // Three Week before high
  41. L2WeekL= TimeFrameGetPrice("L", inWeekly, -3); L2WeekLI = LastValue (L2WeekL,1); // Three Week before low
  42. L2MonthH= TimeFrameGetPrice("H", inMonthly, -3); L2MonthHI = LastValue (L2MonthH,1); // Three Month before high
  43. L2MonthL= TimeFrameGetPrice("L", inMonthly, -3); L2MonthLI = LastValue (L2MonthL,1); // Three Month before low
  44. L3MonthH= TimeFrameGetPrice("H", inMonthly, -4); L3MonthHI = LastValue (L3MonthH,1); // Four Month before high
  45. L3MonthL= TimeFrameGetPrice("L", inMonthly, -4); L3MonthLI = LastValue (L3MonthL,1); // Four Month before low
  46. L4MonthH= TimeFrameGetPrice("H", inMonthly, -5); L4MonthHI = LastValue (L4MonthH,1); // Five Month before high
  47. L4MonthL= TimeFrameGetPrice("L", inMonthly, -5); L4MonthLI = LastValue (L4MonthL,1); // Five Month before low
  48. L3WeekH= TimeFrameGetPrice("H", inWeekly, -4); L3WeekHI = LastValue (L3WeekH,1); // Four Week before high
  49. L3WeekL= TimeFrameGetPrice("L", inWeekly, -4); L3WeekLI = LastValue (L3WeekL,1); // Four Week before low
  50. //----------------------------------------------------------------------------------------------------------------------
  51.  
  52.  
  53. Buy= C>((DayC)+((.382)*(ADM)));
  54. Sell= C<((DayC)-((.382)*(ADM)));
  55.  
  56. Buy=ExRem(Buy,Sell);
  57. Sell=ExRem(Sell,Buy);
  58.  
  59. Short=Sell;
  60. Cover=Buy;
  61.  
  62. BuyPrice=ValueWhen(Buy,C);
  63. SellPrice=ValueWhen(Sell,C);
  64. ShortPrice=ValueWhen(Short,C);
  65. CoverPrice=ValueWhen(Cover,C);
  66.  
  67. BuyTarget1= (0.45*ADM)+BuyPrice;
  68. BuyTarget2= (0.95*ADM)+BuyPrice;
  69. BuyTarget3= (1.95*ADM)+BuyPrice;
  70. SellTarget1= SellPrice-(0.45*ADM);
  71. SellTarget2= SellPrice-(0.95*ADM);
  72. SellTarget3= SellPrice-(1.95*ADM);
  73.  
  74. //------------------------------------------------------------------------------------------------
  75.  
  76. PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
  77. PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
  78. PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
  79. PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
  80. PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
  81. PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
  82.  
  83. Long=Flip(Buy,Sell);
  84. Shrt=Flip(Sell,Buy);
  85.  
  86. BuyPrice=ValueWhen(Buy,C);
  87. SellPrice=ValueWhen(Sell,C);
  88.  
  89. Bdc=(
  90. WriteIf (Buy AND Ref(shrt,-1), " BUY@ "+C+" ","")+
  91. WriteIf(Buy , "LastTrade Profit="+(SellPrice-C)+"","")
  92. );
  93.  
  94. Sdc=(
  95. WriteIf (Sell AND Ref(Long,-1), " SEll@ "+C+" ","")+
  96. WriteIf(Sell , "LastTrade Profit="+(C-BuyPrice)+"","")
  97. );
  98.  
  99. Ndc=(
  100. WriteIf(Long AND NOT Buy, "Long@"+WriteVal((BuyPrice))+" /Profit="+WriteVal((C-BuyPrice))+"","")+
  101. WriteIf(Shrt AND NOT Sell, "Short@"+WriteVal((SellPrice))+" /Profit="+WriteVal((SellPrice-C))+"","")
  102. );
  103.  
  104. BTdc=(
  105. WriteIf(Long AND NOT Buy, "Target1(1/2ADM)"+WriteVal((BuyTarget1))+
  106. "::\nTarget2(One ADM)"+WriteVal((BuyTarget2))+
  107. "::\nTarget3(Two ADM)"+WriteVal((BuyTarget3))+"","")
  108. );
  109.  
  110. STdc=(
  111. WriteIf(Shrt AND NOT Sell, "Target1(1/2ADM)"+WriteVal((SellTarget1))+
  112. "::\nTarget2(One ADM)"+WriteVal((SellTarget2))+
  113. "::\nTarget3(Two ADM)"+WriteVal((SellTarget3))+"","")
  114. );
  115.  
  116. _SECTION_END();
  117.  
  118. trendup = IIf(C>((DayC)+((.382)*(ADM))), colorBlue, colorWhite);
  119. trendcolor = IIf(C<((DayC)-((.382)*(ADM))), colorRed, trendup);
  120. Plot( C, "Close", trendcolor, styleCandle | styleThick );
  121.  
  122. numbars = LastValue(Cum(Status("barvisible")));
  123. hts = -33.5;
  124.  
  125. // Volatility Levels //
  126. DC = DayC; DCI = LastValue (DC,1); // Yesterday Close
  127. BY = ((DayC)+((.382)*(ADM))); BYI = LastValue (BY,1); // Buy Entry Line
  128. BT1 = ((DayC)+((.618)*(ADM))); BT1I = LastValue (BT1,1); // Buy Target Line 1
  129. BT2 = ((DayC)+((.786)*(ADM))); BT2I = LastValue (BT2,1); // Buy Target Line 2
  130. BT3 = ((DayC)+(ADM)); BT3I = LastValue (BT3,1); // Buy Target Line 3
  131. SH = ((DayC)-((.382)*(ADM))); SHI = LastValue (SH,1); // Sell Entry Line
  132. ST1 = ((DayC)-((.618)*(ADM))); ST1I = LastValue (ST1,1); // Sell Target Line 1
  133. ST2 = ((DayC)-((.786)*(ADM))); ST2I = LastValue (ST2,1); // Sell Target Line 2
  134. ST3 = ((DayC)-(ADM)); ST3I = LastValue (ST3,1); // Sell Target Line 3
  135.  
  136. vvl = ParamToggle("Intraday Target Levels","Hide|Show",0);
  137. if(vvl==1) {
  138. Plot(DC, "DC",colorWhite,styleDots|styleLine|styleNoRescale|styleNoTitle);
  139. Plot(BY, "BY",colorLime,styleDots|styleLine|styleNoRescale|styleNoTitle);
  140. Plot(BT1, "BT1",colorGreen,styleDots|styleLine|styleNoRescale|styleNoTitle);
  141. Plot(BT2, "BT2",colorGreen,styleDots|styleLine|styleNoRescale|styleNoTitle);
  142. Plot(BT3, "BT3",colorGreen,styleDots|styleLine|styleNoRescale|styleNoTitle);
  143. Plot(SH, "SH",colorRed,styleDots|styleLine|styleNoRescale|styleNoTitle);
  144. Plot(ST1, "ST1",colorBrown,styleDots|styleLine|styleNoRescale|styleNoTitle);
  145. Plot(ST2, "ST2",colorBrown,styleDots|styleLine|styleNoRescale|styleNoTitle);
  146. Plot(ST3, "ST3",colorBrown,styleDots|styleLine|styleNoRescale|styleNoTitle);
  147.  
  148. PlotText(" DC ", LastValue(BarIndex())-(numbars/Hts), DCI, colorDarkGrey);
  149. PlotText(" Buy " , LastValue(BarIndex())-(numbars/Hts), BYI, colorLime);
  150. PlotText(" Target1 " , LastValue(BarIndex())-(numbars/Hts), BT1I, colorGreen);
  151. PlotText(" Target2 " , LastValue(BarIndex())-(numbars/Hts), BT2I, colorGreen);
  152. PlotText(" Target3 " , LastValue(BarIndex())-(numbars/Hts), BT3I, colorGreen);
  153. PlotText(" Sell " , LastValue(BarIndex())-(numbars/Hts), SHI, colorRed);
  154. PlotText(" Target1 " , LastValue(BarIndex())-(numbars/Hts), ST1I, colorBrown);
  155. PlotText(" Target2 " , LastValue(BarIndex())-(numbars/Hts), ST2I, colorBrown);
  156. PlotText(" Target3 " , LastValue(BarIndex())-(numbars/Hts), ST3I, colorBrown);
  157. }
  158.  
  159. mmwwl = ParamToggle(" MOnthly, Weekly Levels","Hide|Show",1);
  160. if(mmwwl==1) {
  161. Plot(DayH, "PDH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  162. Plot(WeekH, "CWH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  163. Plot(LWeekH, "LWH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  164. Plot(L1WeekH, "2WH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  165. Plot(L2WeekH, "3WH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  166. Plot(L3WeekH, "4WH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  167. Plot(MonthH, "CMH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  168. Plot(LMonthH, "LMH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  169. Plot(L1MonthH, "2MH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  170. Plot(L2MonthH, "3MH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  171. Plot(L3MonthH, "4MH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  172. Plot(L4MonthH, "5MH",colorBlue,styleLine|styleNoRescale|styleNoTitle);
  173.  
  174. Plot(DayL, "PDL",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  175. Plot(WeekL, "CWL",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  176. Plot(LWeekL, "LWL",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  177. Plot(L1WeekL, "2WL",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  178. Plot(L2WeekL, "3WL",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  179. Plot(L3WeekL, "4WL",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  180. Plot(MonthL, "CML",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  181. Plot(LMonthL, "LML",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  182. Plot(L1MonthL, "2ML",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  183. Plot(L2MonthL, "3ML",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  184. Plot(L3MonthL, "4ML",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  185. Plot(L4MonthL, "5ML",colorViolet,styleLine|styleNoRescale|styleNoTitle);
  186.  
  187. PlotText(" PDH ", LastValue(BarIndex())-(numbars/Hts), DayHI, colorBlue);
  188. PlotText(" CWH " , LastValue(BarIndex())-(numbars/Hts), WeekHI, colorBlue);
  189. PlotText(" LWH " , LastValue(BarIndex())-(numbars/Hts), LWeekHI, colorBlue);
  190. PlotText(" 2WH " , LastValue(BarIndex())-(numbars/Hts), L1WeekHI, colorBlue);
  191. PlotText(" 3WH " , LastValue(BarIndex())-(numbars/Hts), L2WeekHI, colorBlue);
  192. PlotText(" 4WH " , LastValue(BarIndex())-(numbars/Hts), L3WeekHI, colorBlue);
  193. PlotText(" CMH " , LastValue(BarIndex())-(numbars/Hts), MonthHI, colorBlue);
  194. PlotText(" LMH " , LastValue(BarIndex())-(numbars/Hts), LMonthHI, colorBlue);
  195. PlotText(" 2MH " , LastValue(BarIndex())-(numbars/Hts), L1MonthHI, colorBlue);
  196. PlotText(" 3MH ", LastValue(BarIndex())-(numbars/Hts), L2MonthHI, colorBlue);
  197. PlotText(" 4MH " , LastValue(BarIndex())-(numbars/Hts), L3MonthHI, colorBlue);
  198. PlotText(" 5MH " , LastValue(BarIndex())-(numbars/Hts), L4MonthHI, colorBlue);
  199.  
  200. PlotText(" PDL " , LastValue(BarIndex())-(numbars/Hts), DayLI, colorViolet);
  201. PlotText(" CWL " , LastValue(BarIndex())-(numbars/Hts), WeekLI, colorViolet);
  202. PlotText(" LWL " , LastValue(BarIndex())-(numbars/Hts), LWeekLI, colorViolet);
  203. PlotText(" 2WL " , LastValue(BarIndex())-(numbars/Hts), L1WeekLI, colorViolet);
  204. PlotText(" 3WL " , LastValue(BarIndex())-(numbars/Hts), L2WeekLI, colorViolet);
  205. PlotText(" 4WL " , LastValue(BarIndex())-(numbars/Hts), L3WeekLI, colorViolet);
  206. PlotText(" CML " , LastValue(BarIndex())-(numbars/Hts), MonthLI, colorViolet);
  207. PlotText(" LML " , LastValue(BarIndex())-(numbars/Hts), LMonthLI, colorViolet);
  208. PlotText(" 2ML " , LastValue(BarIndex())-(numbars/Hts), L1MonthLI, colorViolet);
  209. PlotText(" 3ML ", LastValue(BarIndex())-(numbars/Hts), L2MonthLI, colorViolet);
  210. PlotText(" 4ML " , LastValue(BarIndex())-(numbars/Hts), L3MonthLI, colorViolet);
  211. PlotText(" 5ML " , LastValue(BarIndex())-(numbars/Hts), L4MonthLI, colorViolet);
  212.  
  213. }
  214.  
  215. _SECTION_BEGIN("Background text");
  216. C11=ParamColor("up panel",colorBlack );
  217. C12=ParamColor("dn panel",colorBlack );
  218. C13=Param("fonts",20,10,30,1 );
  219. C14=Param("left-right",2.1,1.0,5.0,0.1 );
  220. C15=Param("up-down",8,1,30,1 );
  221. Miny = Status("axisminy");
  222. Maxy = Status("axismaxy");
  223. lvb = Status("lastvisiblebar");
  224. fvb = Status("firstvisiblebar");
  225. pxwidth = Status("pxwidth");
  226. pxheight = Status("pxheight");
  227. GfxSetBkMode( 0 );
  228. GfxSelectFont("Tahoma", 12, 500, False, False, 0);
  229. GfxSetTextColor(colorCustom12);
  230. GfxSetTextAlign( 6 );
  231. GfxTextOut( "ADM (Average Day Moment) "+WriteVal(ADM,1.2), Status("pxwidth")/C14, Status("pxheight")/C15*1.5);
  232. GfxSelectFont("Tahoma", 15, 600, False, False, 0);
  233. GfxSetTextColor(colorWhite);
  234. GfxSetTextAlign( 6 );
  235. GfxTextOut( "LTP "+WriteVal(C,1.2), Status("pxwidth")/C14, Status("pxheight")/C15);
  236. GfxSelectFont("Tahoma", 12, 400, False, False, 0);
  237. GfxSetTextColor(colorBrightGreen);
  238. GfxTextOut(""+Bdc+"", Status("pxwidth")/C14, Status("pxheight")/C15*2.0);
  239. GfxSelectFont("Tahoma", 12, 400, False, False, 0);
  240. GfxSetTextColor(colorRed);
  241. GfxTextOut(""+Sdc+"", Status("pxwidth")/C14, Status("pxheight")/C15*2.0);
  242. GfxSelectFont("Tahoma", 12, 400, False, False, 0);
  243. GfxSetTextColor(colorYellow);
  244. GfxTextOut(""+Ndc+"", Status("pxwidth")/C14, Status("pxheight")/C15*2.0);
  245. GfxSelectFont("Tahoma", 12, 400, False, False, 0);
  246. GfxSetTextColor(colorGreen);
  247. GfxTextOut(""+BTdc+"", Status("pxwidth")/C14, Status("pxheight")/C15*2.5);
  248. GfxSelectFont("Tahoma", 12, 400, False, False, 0);
  249. GfxSetTextColor(colorGreen);
  250. GfxTextOut(""+STdc+"", Status("pxwidth")/C14, Status("pxheight")/C15*2.5);
  251.  
  252.  
  253. pricechange=(C-Ref(C,-1))*100/Ref(C,-1);
  254. changeponit=C-Ref(C,-1);
  255. Vlp=Param("Volume lookback period",15,10,300,10);
  256. Vrg=MA(V,Vlp);
  257. St = StDev(Vrg,Vlp);
  258. Vp3 = Vrg + 3*st;
  259. Vp2 = Vrg + 2*st;;
  260. Vp1 = Vrg + 1*st;;
  261. Vn1 = Vrg -1*st;
  262. Vn2 = Vrg -2*st;
  263.  
  264. x=Param("xposn",1,0,1000,1);
  265. y=Param("yposn",1,0,1000,1);
  266.  
  267. GfxGradientRect( 1, 1, 1400, 40, colorGrey50, colorDarkGrey);
  268. GfxSetBkMode(0);
  269. GfxSelectFont( "Georgia", 18, 800, False );
  270. GfxSetTextColor( colorWhite );
  271. GfxTextOut( "ULTIMATE VOLATILITY EXPERT ", x+600, y+10 );
  272. GfxSelectFont( "Tahoma", 16, 800, False );
  273. GfxSetTextColor( colorGold );
  274. GfxTextOut( Name(), x+100, y+10 );
  275. GfxSelectFont( "Century Gothic", 15, 100, False );
  276. GfxSetTextColor( colorWhite );
  277. GfxTextOut( Date(), x+1000, y+10 );
  278. GfxSelectFont( "Comic Sans MS", 15, 500, False );
  279. GfxSetTextColor( colorYellow );
  280. GfxTextOut( Interval(2), x+275, y+10 );
  281. //------------------------------------------------------------ H, L, O, C----------------------
  282. GfxGradientRect( 1, 40, 1400, 55, colorGrey50, colorDarkGrey );
  283. GfxSetBkMode(0);
  284. GfxSelectFont( "Areal", 9, 200, False );
  285. GfxSetTextColor( colorWhite );
  286. GfxTextOut( "High:"+WriteVal(H,1.2), x+100, y+40 );
  287. GfxSelectFont( "Areal", 9, 200, False );
  288. GfxSetTextColor( colorWhite );
  289. GfxTextOut( "Low:"+WriteVal(L,1.2), x+200, y+40 );
  290. GfxSelectFont( "Areal", 9, 200, False );
  291. GfxSetTextColor( colorWhite );
  292. GfxTextOut( "Open:"+WriteVal(O,1.2), x+300, y+40 );
  293. GfxSelectFont( "Areal", 9, 200, False );
  294. GfxSetTextColor( colorWhite );
  295. GfxTextOut( "Close:"+WriteVal(C,1.2), x+400, y+40 );
  296. GfxSelectFont( "Script MT Bold", 12, 100, False );
  297. GfxSetTextColor( colorWhite );
  298. GfxTextOut( "Created By Murali Krishna ", x+1000, y+39 );
  299. //-----------------------------------------------------------Valume-------------------------------
  300. GfxSelectFont( "Tahoma", 9, 200, False );
  301. GfxSetTextColor( colorWhite );
  302. GfxTextOut( "Volume="+WriteVal(V,1.2), x+500, y+40 );
  303. GfxSelectFont( "Tahoma", 9, 200, False );
  304. GfxSetTextColor( colorLime );
  305. GfxTextOut( WriteIf(V>Vp2,"Very High",""), x+600, y+40 );
  306. GfxSelectFont( "Tahoma", 9, 200, False );
  307. GfxSetTextColor( colorLime );
  308. GfxTextOut( WriteIf(V>Vp1," High",""), x+600, y+40 );
  309. GfxSelectFont( "Tahoma", 9, 200, False );
  310. GfxSetTextColor( colorLime );
  311. GfxTextOut( WriteIf(V>Vrg,"Above Average",""), x+600, y+40 );
  312. GfxSelectFont( "Tahoma", 9, 200, False );
  313. GfxSetTextColor( colorRed );
  314. GfxTextOut( WriteIf(V<Vrg AND V>Vn1,"Less than Average",""), x+600, y+40 );
  315. GfxSelectFont( "Tahoma", 9, 200, False );
  316. GfxSetTextColor( colorRed );
  317. GfxTextOut( WriteIf(V<Vn1,"Low",""), x+600, y+40 );
  318. //----------------------------------------------------------------Leveles----------------------------
  319.  
  320. GfxGradientRect( 1, 185, 90, 200, colorGrey50,colorDarkGrey );
  321. GfxSetBkMode(0);
  322. GfxSelectFont( "Tahoma", 10, 300, False );
  323. GfxSetTextColor( colorOrange );
  324. GfxTextOut( "Levels ", x+45, y+185 );
  325.  
  326. GfxGradientRect( 1, 200, 90, 215, colorDarkGrey,colorDarkRed );
  327. GfxSetBkMode(0);
  328. GfxSelectFont( "Tahoma", 10, 300, False );
  329. GfxSetTextColor( colorWhite );
  330. GfxTextOut( WriteIf (L4MonthH>C, " 5MH "+WriteVal(L4MonthH,1.2)+" ",""), x+50, y+200 );
  331.  
  332. GfxGradientRect( 1, 215, 90, 230, colorDarkGrey, colorDarkRed );
  333. GfxSetBkMode(0);
  334. GfxSelectFont( "Tahoma", 10, 300, False );
  335. GfxSetTextColor( colorWhite );
  336. GfxTextOut( WriteIf (L3MonthH>C, " 4MH "+WriteVal(L3MonthH,1.2)+" ",""), x+50, y+215 );
  337.  
  338. GfxGradientRect( 1, 230, 90, 245, colorDarkGrey, colorDarkRed );
  339. GfxSetBkMode(0);
  340. GfxSelectFont( "Tahoma", 10, 300, False );
  341. GfxSetTextColor( colorWhite );
  342. GfxTextOut( WriteIf (L2MonthH>C, " 3MH "+WriteVal(L2MonthH,1.2)+" ",""), x+50, y+230 );
  343.  
  344. GfxGradientRect( 1, 245, 90, 260, colorDarkGrey, colorDarkRed );
  345. GfxSetBkMode(0);
  346. GfxSelectFont( "Tahoma", 10, 300, False );
  347. GfxSetTextColor( colorWhite );
  348. GfxTextOut( WriteIf (L1MonthH>C, " 2MH "+WriteVal(L1MonthH,1.2)+" ",""), x+50, y+245 );
  349.  
  350. GfxGradientRect( 1, 260, 90, 275, colorDarkGrey, colorDarkRed );
  351. GfxSetBkMode(0);
  352. GfxSelectFont( "Tahoma", 10, 300, False );
  353. GfxSetTextColor( colorWhite );
  354. GfxTextOut( WriteIf (LMonthH>C, " LMH "+WriteVal(LMonthH,1.2)+" ",""), x+50, y+260 );
  355.  
  356. GfxGradientRect( 1, 275, 90, 290, colorDarkGrey, colorDarkRed );
  357. GfxSetBkMode(0);
  358. GfxSelectFont( "Tahoma", 10, 300, False );
  359. GfxSetTextColor( colorWhite );
  360. GfxTextOut( WriteIf (MonthH>C, " CMH "+WriteVal(MonthH,1.2)+" ",""), x+50, y+275 );
  361.  
  362. GfxGradientRect( 1, 290, 90, 305, colorDarkGrey, colorDarkRed );
  363. GfxSetBkMode(0);
  364. GfxSelectFont( "Tahoma", 10, 300, False );
  365. GfxSetTextColor( colorWhite );
  366. GfxTextOut( WriteIf (L3WeekH>C, " 4WH "+WriteVal(L3WeekH,1.2)+" ",""),x+50, y+290 );
  367.  
  368. GfxGradientRect( 1, 305, 90, 320, colorDarkGrey, colorDarkRed );
  369. GfxSetBkMode(0);
  370. GfxSelectFont( "Tahoma", 10, 300, False );
  371. GfxSetTextColor( colorWhite );
  372. GfxTextOut( WriteIf (L2WeekH>C, " 3WH "+WriteVal(L2WeekH,1.2)+" ",""), x+50, y+305 );
  373.  
  374. GfxGradientRect( 1, 320, 90, 335, colorDarkGrey, colorDarkRed );
  375. GfxSetBkMode(0);
  376. GfxSelectFont( "Tahoma", 10, 300, False );
  377. GfxSetTextColor( colorWhite );
  378. GfxTextOut( WriteIf (L1WeekH>C, " 2WH "+WriteVal(L1WeekH,1.2)+" ",""), x+50, y+320 );
  379.  
  380. GfxGradientRect( 1, 335, 90, 350, colorDarkGrey, colorDarkRed );
  381. GfxSetBkMode(0);
  382. GfxSelectFont( "Tahoma", 10, 300, False );
  383. GfxSetTextColor( colorWhite );
  384. GfxTextOut( WriteIf (LWeekH>C, " 1WH "+WriteVal(LWeekH,1.2)+" ","") , x+50, y+335 );
  385.  
  386. GfxGradientRect( 1, 350, 90, 365, colorDarkGrey, colorDarkRed );
  387. GfxSetBkMode(0);
  388. GfxSelectFont( "Tahoma", 10, 300, False );
  389. GfxSetTextColor( colorWhite );
  390. GfxTextOut( WriteIf (WeekH>C, " CWH "+WriteVal(WeekH,1.2)+" ",""), x+50, y+350 );
  391.  
  392. GfxGradientRect( 1, 365, 90, 380, colorDarkGrey, colorDarkRed );
  393. GfxSetBkMode(0);
  394. GfxSelectFont( "Tahoma", 10, 300, False );
  395. GfxSetTextColor( colorWhite );
  396. GfxTextOut( WriteIf (DayH>C, " PDH "+WriteVal(DayH,1.2)+" ",""), x+50, y+365 );
  397.  
  398. GfxGradientRect( 1, 380, 90, 395, colorLightBlue , colorBlue );
  399. GfxSetBkMode(0);
  400. GfxSelectFont( "Tahoma", 10, 300, False );
  401. GfxSetTextColor( colorCustom12);
  402. GfxTextOut( WriteIf (C, " LTP "+WriteVal(C,1.2)+" ",""), x+50, y+380 );
  403.  
  404. GfxGradientRect( 1, 395, 90, 410, colorDarkGrey,colorDarkGreen);
  405. GfxSetBkMode(0);
  406. GfxSelectFont( "Tahoma", 10, 300, False );
  407. GfxSetTextColor( colorWhite );
  408. GfxTextOut( WriteIf (DayL<C, " PDL "+WriteVal(DayL,1.2)+" ",""), x+50, y+395 );
  409.  
  410. GfxGradientRect( 1, 410, 90, 425, colorDarkGrey, colorDarkGreen );
  411. GfxSetBkMode(0);
  412. GfxSelectFont( "Tahoma", 10, 300, False );
  413. GfxSetTextColor( colorWhite );
  414. GfxTextOut( WriteIf (WeekL<C, " CWL "+WriteVal(WeekL,1.2)+" ",""), x+50, y+410 );
  415.  
  416. GfxGradientRect( 1, 425, 90, 440, colorDarkGrey, colorDarkGreen );
  417. GfxSetBkMode(0);
  418. GfxSelectFont( "Tahoma", 10, 300, False );
  419. GfxSetTextColor( colorWhite );
  420. GfxTextOut( WriteIf (LWeekL<C, " 1WL "+WriteVal(LWeekL,1.2)+" ",""), x+50, y+425 );
  421.  
  422. GfxGradientRect( 1, 440, 90, 455, colorDarkGrey, colorDarkGreen );
  423. GfxSetBkMode(0);
  424. GfxSelectFont( "Tahoma", 9, 300, False );
  425. GfxSetTextColor( colorWhite );
  426. GfxTextOut( WriteIf (L1WeekL<C, " 2WL "+WriteVal(L1WeekL,1.2)+" ",""), x+50, y+440);
  427.  
  428. GfxGradientRect( 1, 455, 90, 470, colorDarkGrey, colorDarkGreen );
  429. GfxSetBkMode(0);
  430. GfxSelectFont( "Tahoma", 10, 300, False );
  431. GfxSetTextColor( colorWhite );
  432. GfxTextOut( WriteIf (L2WeekL<C, " 3WL "+WriteVal(L2WeekL,1.2)+" ",""), x+50, y+455);
  433.  
  434. GfxGradientRect( 1, 470, 90, 485, colorDarkGrey, colorDarkGreen );
  435. GfxSetBkMode(0);
  436. GfxSelectFont( "Tahoma", 10, 300, False );
  437. GfxSetTextColor( colorWhite );
  438. GfxTextOut( WriteIf (L3WeekL<C, " 4WL "+WriteVal(L3WeekL,1.2)+" ",""), x+50, y+470);
  439.  
  440. GfxGradientRect( 1, 485, 90, 500, colorDarkGrey, colorDarkGreen );
  441. GfxSetBkMode(0);
  442. GfxSelectFont( "Tahoma", 10, 300, False );
  443. GfxSetTextColor( colorWhite );
  444. GfxTextOut( WriteIf (MonthL<C, " CML "+WriteVal(MonthL,1.2)+" ",""), x+50, y+485);
  445.  
  446. GfxGradientRect( 1, 500, 90, 515, colorDarkGrey, colorDarkGreen );
  447. GfxSetBkMode(0);
  448. GfxSelectFont( "Tahoma", 10, 300, False );
  449. GfxSetTextColor( colorWhite );
  450. GfxTextOut( WriteIf (LMonthL<C, " 1ML "+WriteVal(LMonthL,1.2)+" ",""), x+50, y+500);
  451.  
  452. GfxGradientRect( 1, 515, 90, 530, colorDarkGrey, colorDarkGreen );
  453. GfxSetBkMode(0);
  454. GfxSelectFont( "Tahoma", 10, 300, False );
  455. GfxSetTextColor( colorWhite );
  456. GfxTextOut( WriteIf (L1MonthL<C, " 2ML "+WriteVal(L1MonthL,1.2)+" ",""), x+50, y+515);
  457.  
  458. GfxGradientRect( 1, 530, 90, 545, colorDarkGrey, colorDarkGreen );
  459. GfxSetBkMode(0);
  460. GfxSelectFont( "Tahoma", 10, 300, False );
  461. GfxSetTextColor( colorWhite );
  462. GfxTextOut( WriteIf (L2MonthL<C, " 3ML "+WriteVal(L2MonthL,1.2)+" ",""), x+50, y+530);
  463.  
  464. GfxGradientRect( 1, 545, 90, 560, colorDarkGrey, colorDarkGreen );
  465. GfxSetBkMode(0);
  466. GfxSelectFont( "Tahoma", 10, 300, False );
  467. GfxSetTextColor( colorWhite );
  468. GfxTextOut( WriteIf (L3MonthL<C, " 4ML "+WriteVal(L3MonthL,1.2)+" ",""), x+50, y+545);
  469.  
  470. GfxGradientRect( 1, 560, 90, 575, colorDarkGrey, colorDarkGreen );
  471. GfxSetBkMode(0);
  472. GfxSelectFont( "Tahoma", 10, 300, False );
  473. GfxSetTextColor( colorWhite );
  474. GfxTextOut( WriteIf (L4MonthL<C, " 5ML "+WriteVal(L4MonthL,1.2)+" ",""), x+50, y+560);
  475.  
  476. _SECTION_BEGIN("Time Left");
  477. function GetSecondNum()
  478. {
  479. Time = Now( 4 );
  480. Seconds = int( Time % 100 );
  481. Minutes = int( Time / 100 % 100 );
  482. Hours = int( Time / 10000 % 100 );
  483. SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
  484. return SecondNum;
  485. }
  486. RequestTimedRefresh( 1 );
  487. TimeFrame = Interval();
  488. SecNumber = GetSecondNum();
  489. Newperiod = SecNumber % TimeFrame == 0;
  490. SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
  491. SecsToGo = TimeFrame - SecsLeft;
  492.  
  493. x=Param("xposn",0,0,1000,1);
  494. y=Param("yposn",900,0,1000,1);
  495.  
  496. GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );
  497. GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );
  498. if ( NewPeriod )
  499. {
  500. GfxSelectSolidBrush( colorYellow );
  501. GfxSelectPen( colorYellow, 2 );
  502. }
  503.  
  504. cx = Param( "cxposn", 150, 0, 1250, 1 );
  505. cy = Param( "cyposn", 61, 0, 500, 1 );
  506. GfxSelectFont( "Candara", 10, 98, False );
  507. //gfxcup = SelectedValue(C > Ref(C,-1));
  508. //gfxpcolor = IIf(gfxcup,colorBrightGreen,colorRed);
  509. GfxSetTextColor(colorBrightGreen);
  510. //GfxSetTextColor( colorWhite );
  511. GfxTextOut( "Time left for candle close " + SecsToGo + " ", cx, cy );
  512. _SECTION_END();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement