retesere20

---recyclr--- old-drawtext-code

Oct 5th, 2018
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ======================= example usage in indicator (removed due to TS-style dictionary sloweness)==========================
  2.  
  3. using elsystem.collections;
  4.  
  5. vars: Dictionary MyObj(null);
  6. once MyObj = dictionary.create();
  7. MyObj.Items["up_down"] =false;
  8. MyObj.Items["price"] =low;
  9. MyObj.Items["prefix"]="arrrrrrr"+"_above";
  10. MyObj.Items["barnumber"]=currentbar;
  11. MyObj.Items["color"]= red;
  12. MyObj.Items["size"] =18;
  13. MyObj.Items["type"]=2;
  14. MyObj.Items["arrowDistanced"]=1; //distance ticks from bar
  15. MyObj.Items["text"]=text;
  16.  
  17. value1= tt_drawarrowfull(MyObj);
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. ====================== used this code in function to parse =============================
  26.  
  27.  
  28.  
  29. _string=MyObj.Items["up_down"] astype string;
  30. up_down_used = _string = "up" or _string = "above" or _string = "down" or _string = "below";
  31. up_down_face = _string = "up" or _string = "above";
  32. CreateArrow(true,
  33. up_down_used,
  34. iff( MyObj.Contains("barnumber"), MyObj.Items["barnumber"] astype int, CurrentBar astype int ) astype int,
  35. MyObj.Items["up_down"] astype string,
  36. iffstring( MyObj.Contains("prefix"), MyObj.Items["prefix"] astype string, "arrow_" ),
  37. iff( MyObj.Contains("price"), MyObj.Items["price"] astype double, high) + iff(not (MyObj.Contains("arrowDistanced")), 0, (MyObj.Items["arrowDistanced"] astype int) * tt_ticksize * iff(not up_down_used,0, iff(up_down_face, +1, -1)) astype double) ,
  38. Color.FromArgb( iff( MyObj.Contains("color"), MyObj.Items["color"] astype int, yellow) ),
  39. iff( MyObj.Contains("size"), (MyObj.Items["size"] astype int)*1.00, 12.0 ) astype double,
  40. iff( MyObj.Contains("type"), (MyObj.Items["type"] astype int)*1.00, 1.0 ) astype double,
  41. iffstring( MyObj.Contains("text"), MyObj.Items["text"] astype string, "")
  42. );
RAW Paste Data