Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This a light Version part of SymbolsToolGFX.AFL , has NOT chartID so you can use it as include or drag&drop into graphic charts
- // i will save this afl as SymbolsToolGFX_DragDrop.afl
- // By Panos Boufardeas Jan-2015 (Ver 7)
- // this Afl runs for Amibroker Version 5.80 and above as we use the function PlotTextSetFont
- filename="<b>SymbolsToolV7_DragDrop - \nWith persistent static variables </b>";
- Plot( C, "", colorWhite, styleBar, 0, 0, 0 );
- SetBarsRequired( -2, -2 );
- Bar = Nz( StaticVarGet( "st~Bar" ),0) ;
- BarColor = Nz( StaticVarGet( "st~BarColor" ),0) ;
- fBar= Nz(StaticVarget("stf~Bar"),0);
- // RequestTimedRefresh( 0.1, True );
- ////// -1)---- Loop Sets a Number ID for every single Fonts and run Once --------
- // examble of the first line = StaticVarSetText( "st~Symbol_1", "j" );
- Symbolvar=StaticVarGetText( "st~Symbol_RunOnce");
- if ( Symbolvar == "" )
- {
- 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";
- for ( i = 1; ( Font = StrExtract( FontList, i - 1 ) ) != ""; i++ )
- {
- StaticVarSetText( "st~Symbol_" + i, Font );
- // _TRACE("#, Symbol_"+i +" = "+ Font );
- }
- // _TRACE("#, StaticVarSetText Symbols are NOT Set: "+i );
- for ( i = 1; i < 10; i++ ) // PlotText Lazy Boy
- {
- Fonts2 = StrExtract( "X,1,2,3,4,5,A,B,C", i - 1 );
- StaticVarSetText( "st~Elliot_" + i, Fonts2 );
- // _TRACE("#, st~Elliot_"+i +" = "+ Fonts2 );
- }
- StaticVarSetText( "st~Symbol_RunOnce", "RunOnce" );
- }
- else
- {
- //_TRACE("#, StaticVarSetText Symbols are Set Once:" );
- }
- ////// -2)-------- Display PlotText --------
- FirstVisibleBar = Status("FirstVisibleBar");
- Lastvisiblebar = Status("LastVisibleBar");
- Yname = "Y" + Name() + Interval();
- YLazyBoy = "YY" + Name() + Interval();
- for( i = Firstvisiblebar; i <= Lastvisiblebar AND i < BarCount; i++) // Quick PlotText - LazyBoy
- {
- shapePos[i] = StaticVarGet( YLazyBoy + i );
- if ( fBar[i] != 0 )
- PlotText("\n"+StaticVarGetText( "st~Elliot_" + fbar[i] ),i, shapePos[i], colorBlack,barcolor[i] );
- }
- for( i = Firstvisiblebar; i <= Lastvisiblebar AND i < BarCount; i++)
- {
- shapePos[i] = StaticVarGet( Yname + i );
- if ( 0< bar[i] AND bar[i] <11 ) // 1st Row
- PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 2",20,i,shapePos[i],barcolor[i] );
- if ( 10< bar[i] AND bar[i] <31 ) //Row 2,3
- PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Arial",14,i,shapePos[i],barcolor[i]);
- if ( 37< bar[i] AND bar[i] <41 ) //Row 4
- PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Arial",20,i,shapePos[i],barcolor[i]);
- if ( 30< bar[i] AND bar[i] <38 ) //Row 4
- PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 2",20,i,shapePos[i],barcolor[i]);
- if ( 40< bar[i] AND bar[i] <49 ) //Row 5
- PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings",20,i,shapePos[i],barcolor[i]);
- if ( 50< bar[i] AND bar[i] <53 ) //Row 6
- if (bar[i] ==51 ) // Down Triangle
- PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 3",20,i,shapePos[i],colorRed);
- if (bar[i] ==52 ) // Up Triangle
- PlotTextSetFont(StaticVarGetText( "st~Symbol_" + bar[i] ),"Wingdings 3",20,i,shapePos[i],colorGreen);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement