Dummy input

post your indicators here

Moderator: moderators

blackda14
rank: <50 posts
rank: <50 posts
Posts: 7
Joined: Mon Nov 16, 2009 5:04 am
Reputation: 0
Gender: Male

Dummy input

Postby blackda14 » Sun Oct 17, 2010 6:53 pm

How can I put or change a label input to be variable in a code? In below code how can I make the Plot 2 and Plot 3 label to be able to be changed from the format indicator box. From what I found so far I have to change something (dummy"") just unsure how. What Im trying to accomplish in code below is name the Limit1 and Limit 2 without having to keep changing the actual code that way I can insert the indicator multiple times with different parameters for the limits into RS and keep straight which limits I put into the code.
Thanks
Dennis

Code: Select all

inputs:
       
   iDecimals(2) ,
   iMessage("Between Limits"),
   iPrice( CloseD(0) ),
   iLimit1( xAverage(closeD(0), 13) ),
   iLimit2( averagefc(closeD(0), 20) ),
   iColorBG( darkgray ),
   iColor1( magenta ),
   iColor2( cyan ) ;


variables:
   xZone(0),

   diff13(0),
   diff20(0),

   xLimit1(0),
   xLimit2(0);

variables:
 
xRadar(GetAppInfo(aiApplicationType)),

xPeriods(60),
xInterval(0),

sFirstPass(true),
 
xInd(0),
tInd(""),
tAlert("");

variables:
 
FG1(white),
BG1(black),

fg2(white),
bg2(black),

fg3(white),
bg3(black),

fg4(white),
bg4(black);
   
{commentary variables}
variables:
xcomm(0),
oComm1( "" ),    
oComm2( "" ),    
oComm3( "" ),    
oComm4( "" ),    
oComm5( "" ),
oComm6( "" ),
oComm7( "" ),
oComm8( "" ),
oComm9( "" ),    
oComm10( "" );
   


{ INITIALIZE }

FG1 = WHITE;
BG1 = BLACK;

fg2 = iColor1;
bg2 = BLACK;

fg3 = iColor2;
bg3 = BLACK;

fg4 = WHITE;
bg4 = BLACK;

tInd   = ""; 

tAlert   = ""; 

   { criteria }

xLimit1 = round(iLimit1, iDecimals);

xLimit2 = round(iLimit2, iDecimals);


diff13 = close -  xLimit1;

diff20 = xLimit2 - close;


 

if close <= xLimit2
and  close <= xLimit1
then BEGIN
   tAlert  =   "Close <= Limits" ;
   xZone = diff20;
   Fg1 = red;
   Bg1 = BLACK;
   Fg4 = red;
   Bg4 = BLACK;
END
else
if close > xLimit1
and  close > xLimit2   
then BEGIN
   tAlert  =   "Close > Limits" ;
   xZone = diff13;
   Fg1 = green;
   Bg1 = BLACK;
   Fg4 = green;
   Bg4 = BLACK;

END
else BEGIN
   tAlert  =   iMessage ;
   xZone = close;
   Fg1 = black;
   Bg1 = yellow;
//   Fg2 = yellow;
//  Fg3 = yellow;
   Fg4 = BLACK;
   Bg4 = yellow;
END;
 


if xRadar = 2
then BEGIN
   
if xLimit1 < xLimit1[1]
then BEGIN
   Fg2 = red;
   Bg2 = BLACK;
END
else
if xLimit1 >= xLimit1[1]    
then BEGIN
   Fg2 = green;
   Bg2 = BLACK;
END;

if xLimit2 < xLimit2[1]
then BEGIN
   Fg3 = red;
   Bg3 = BLACK;
END
else
if xLimit2 >= xLimit2[1]    
then BEGIN
   Fg3 = green;
   Bg3 = BLACK;
END;

   
if xLimit1 < xLimit2
   then Bg3 = iColorBG
   else if xLimit1 > xLimit2
         then Bg2 = iColorBG;

END; // if xRadar = 2


{ Alert }

if tAlert <> ""
and tAlert <> tAlert[1]
   then Alert( tAlert ) ;


// aiApplicationType 1 = chart, 2 = radar


If GetAppInfo(aiApplicationType) = 2
then begin
   Plot1(xZone, "Zone",   Fg1 ) ;
   SetPlotBGColor( 1, bg1 );
   
   Plot4(tAlert, "Message",   Fg4 ) ;
   SetPlotBGColor( 4, bg4 );

end ;

//If GetAppInfo(aiApplicationType) = 1
//then begin
   Plot2(xLimit1, "Limit1",   Fg2 ) ;
   SetPlotBGColor( 2, bg2 );

   Plot3(xLimit2, "Limit2",   Fg3 ) ;
   SetPlotBGColor( 3, bg3 );
//end;

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

Return to “Tradestation indicators”