Advertisement
panosbouf

SymbolsToolGFX_DragDrop.afl

Jan 28th, 2015
1,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. // This a light Version part of SymbolsToolGFX.AFL , has NOT chartID so you can use it as include or drag&drop into graphic charts
  2. // i will save this afl as SymbolsToolGFX_DragDrop.afl
  3. // By Panos Boufardeas Jan-2015 (Ver 7)
  4.  
  5. // this Afl runs for Amibroker Version 5.80 and above as we use the function PlotTextSetFont
  6.  
  7. filename="<b>SymbolsToolV7_DragDrop - \nWith persistent static variables </b>";
  8.  
  9. Plot( C, "", colorWhite, styleBar, 0, 0, 0 );
  10. SetBarsRequired( -2, -2 );
  11. Bar = Nz( StaticVarGet( "st~Bar" ),0) ;
  12. BarColor = Nz( StaticVarGet( "st~BarColor" ),0) ;
  13. fBar= Nz(StaticVarget("stf~Bar"),0);
  14. // RequestTimedRefresh( 0.1, True );
  15.  
  16. ////// -1)---- Loop Sets a Number ID for every single Fonts and run Once --------
  17. // examble of the first line = StaticVarSetText( "st~Symbol_1", "j" );
  18. Symbolvar=StaticVarGetText( "st~Symbol_RunOnce");
  19.  
  20. if ( Symbolvar == "" )
  21. {
  22. FontList = "j,k,l,m,n,o,p,q,r,i,A,B,C,W,X,Y,x,a,b,c,(i),(ii),(iii),(iv),(v),(a),(b),(c),(d),(e),D,E,<,=,N,R,T,?,!,+,J,L,O,M,N,U,R,T,-,-,q,p";
  23.  
  24. for ( i = 1; ( Font = StrExtract( FontList, i - 1 ) ) != ""; i++ )
  25. {
  26. StaticVarSetText( "st~Symbol_" + i, Font );
  27. // _TRACE("#, Symbol_"+i +" = "+ Font );
  28. }
  29.  
  30. // _TRACE("#, StaticVarSetText Symbols are NOT Set: "+i );
  31. for ( i = 1; i < 10; i++ ) // PlotText Lazy Boy
  32. {
  33. Fonts2 = StrExtract( "X,1,2,3,4,5,A,B,C", i - 1 );
  34. StaticVarSetText( "st~Elliot_" + i, Fonts2 );
  35. // _TRACE("#, st~Elliot_"+i +" = "+ Fonts2 );
  36. }
  37.  
  38. StaticVarSetText( "st~Symbol_RunOnce", "RunOnce" );
  39. }
  40. else
  41. {
  42. //_TRACE("#, StaticVarSetText Symbols are Set Once:" );
  43. }
  44.  
  45.  
  46. ////// -2)-------- Display PlotText --------
  47. FirstVisibleBar = Status("FirstVisibleBar");
  48. Lastvisiblebar = Status("LastVisibleBar");
  49.  
  50. Yname = "Y" + Name() + Interval();
  51. YLazyBoy = "YY" + Name() + Interval();
  52.  
  53. for( i = Firstvisiblebar; i <= Lastvisiblebar AND i < BarCount; i++) // Quick PlotText - LazyBoy
  54. {
  55. shapePos[i] = StaticVarGet( YLazyBoy + i );
  56. if ( fBar[i] != 0 )
  57. PlotText("\n"+StaticVarGetText( "st~Elliot_" + fbar[i] ),i, shapePos[i], colorBlack,barcolor[i] );
  58. }
  59.  
  60.  
  61. for( i = Firstvisiblebar; i <= Lastvisiblebar AND i < BarCount; i++)
  62. {
  63. shapePos[i] = StaticVarGet( Yname + i );
  64.  
  65. if ( 0< bar[i] AND bar[i] <11 ) // 1st Row
  66. PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 2",20,i,shapePos[i],barcolor[i] );
  67.  
  68. if ( 10< bar[i] AND bar[i] <31 ) //Row 2,3
  69. PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Arial",14,i,shapePos[i],barcolor[i]);
  70.  
  71. if ( 37< bar[i] AND bar[i] <41 ) //Row 4
  72. PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Arial",20,i,shapePos[i],barcolor[i]);
  73.  
  74. if ( 30< bar[i] AND bar[i] <38 ) //Row 4
  75. PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 2",20,i,shapePos[i],barcolor[i]);
  76.  
  77. if ( 40< bar[i] AND bar[i] <49 ) //Row 5
  78. PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings",20,i,shapePos[i],barcolor[i]);
  79.  
  80. if ( 50< bar[i] AND bar[i] <53 ) //Row 6
  81. if (bar[i] ==51 ) // Down Triangle
  82. PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 3",20,i,shapePos[i],colorRed);
  83. if (bar[i] ==52 ) // Up Triangle
  84. PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 3",20,i,shapePos[i],colorGreen);
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement