/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + / /  
 / / )       _ _ _ _     _     _     _ _ _ _     _ _ _ _     _ _ _ _     _ _ _ _     _ _     _ _         _ _             _ _ _     _ _ _ _ _     _ _     _ _       ( / /  
 / / )     (   _ _ _ ) (   \ /   ) (     _   \ (     _   \ (   _ _ _ ) (   _ _ _ ) (     \ /     )     / _ _ \         /   _ _ ) (     _     ) (     \ /     )     ( / /  
 / / )       ) _ _ )     )     (     ) ( _ )   ) )       /   ) _ _ )     ) _ _ )     )         (     / ( _ _ ) \     (   ( _ _     ) ( _ ) (     )         (       ( / /  
 / / )     ( _ _ )     ( _ / \ _ ) ( _ _ _ _ / ( _ ) \ _ ) ( _ _ _ _ ) ( _ _ _ _ ) ( _ / \ / \ _ ) ( _ _ ) ( _ _ ) ( ) \ _ _ _ ) ( _ _ _ _ _ ) ( _ / \ / \ _ )     ( / /  
 / / )       h t t p s : / / f x d r e e m a . c o m                                                           C o p y r i g h t   2 0 2 1 ,   f x D r e e m a     ( / /  
 / / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + / /  
 # p r o p e r t y   c o p y r i g h t       " "  
 # p r o p e r t y   l i n k                 " h t t p s : / / f x d r e e m a . c o m "  
 # p r o p e r t y   d e s c r i p t i o n   " "  
 # p r o p e r t y   v e r s i o n           " 1 . 0 "  
 # p r o p e r t y   s t r i c t  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / /   |                                               I N P U T   P A R A M E T E R S ,   G L O B A L   V A R I A B L E S ,   C O N S T A N T S ,   I M P O R T S   a n d   I N C L U D E S                                                 |   / /  
 / /   |                                             S y s t e m   a n d   C u s t o m   v a r i a b l e s   a n d   o t h e r   d e f i n i t i o n s   u s e d   i n   t h e   p r o j e c t                                               |   / /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   S y s t e m   c o n s t a n t s   ( p r o j e c t   s e t t i n g s )   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 / / - -  
 # d e f i n e   P R O J E C T _ I D   " m t 4 - 8 3 2 5 "  
 / / - -  
 / /   P o i n t   F o r m a t   R u l e s  
 # d e f i n e   P O I N T _ F O R M A T _ R U L E S   " 0 . 0 0 1 = 0 . 0 1 , 0 . 0 0 0 0 1 = 0 . 0 0 0 1 , 0 . 0 0 0 0 0 1 = 0 . 0 0 0 1 , X A U U S D = 0 . 1 "   / /   t h i s   i s   d e s e r i a l i z e d   i n   a   s p e c i a l   f u n c t i o n   l a t e r  
 # d e f i n e   E N A B L E _ S P R E A D _ M E T E R   t r u e  
 # d e f i n e   E N A B L E _ S T A T U S   t r u e  
 # d e f i n e   E N A B L E _ T E S T _ I N D I C A T O R S   t r u e  
 / / - -  
 / /   E v e n t s   O n / O f f  
 # d e f i n e   E N A B L E _ E V E N T _ T I C K   1   / /   e n a b l e   " T i c k "   e v e n t  
 # d e f i n e   E N A B L E _ E V E N T _ T R A D E   0   / /   e n a b l e   " T r a d e "   e v e n t  
 # d e f i n e   E N A B L E _ E V E N T _ T I M E R   0   / /   e n a b l e   " T i m e r "   e v e n t  
 / / - -  
 / /   V i r t u a l   S t o p s  
 # d e f i n e   V I R T U A L _ S T O P S _ E N A B L E D   0   / /   e n a b l e   v i r t u a l   s t o p s  
 # d e f i n e   V I R T U A L _ S T O P S _ T I M E O U T   0   / /   v i r t u a l   s t o p s   t i m e o u t  
 # d e f i n e   U S E _ E M E R G E N C Y _ S T O P S   " n o "   / /   " y e s "   t o   u s e   e m e r g e n c y   ( h a r d   s t o p s )   w h e n   v i r t u a l   s t o p s   a r e   i n   u s e .   " a l w a y s "   t o   u s e   E M E R G E N C Y _ S T O P S _ A D D   a s   e m e r g e n c y   s t o p s   w h e n   t h e r e   i s   n o   v i r t u a l   s t o p .  
 # d e f i n e   E M E R G E N C Y _ S T O P S _ R E L   0   / /   u s e   0   t o   d i s a b l e   h a r d   s t o p s   w h e n   v i r t u a l   s t o p s   a r e   e n a b l e d .   U s e   a   v a l u e   > = 0   t o   a u t o m a t i c a l l y   s e t   h a r d   s t o p s   w i t h   v i r t u a l .   E x a m p l e :   i f   2   i s   u s e d ,   t h e n   h a r d   s t o p s   w i l l   b e   2   t i m e s   b i g g e r   t h a n   v i r t u a l   o n e s .  
 # d e f i n e   E M E R G E N C Y _ S T O P S _ A D D   0   / /   a d d   p i p s   t o   r e l a t i v e   s i z e   o f   e m e r g e n c y   s t o p s   ( h a r d   s t o p s )  
 / / - -  
 / /   S e t t i n g s   f o r   e v e n t s  
 # d e f i n e   O N _ T R A D E _ R E A L T I M E   0   / /  
 # d e f i n e   O N _ T I M E R _ P E R I O D   6 0   / /   T i m e r   e v e n t   p e r i o d   ( i n   s e c o n d s )  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   S y s t e m   c o n s t a n t s   ( p r e d e f i n e d   c o n s t a n t s )   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 / / - -  
 / /   B l o c k s   L o o k u p   F u n c t i o n s  
 s t r i n g   f x d B l o c k s L o o k u p T a b l e [ ] ;  
  
 # d e f i n e   T L O B J P R O P _ T I M E 1   8 0 1  
 # d e f i n e   O B J P R O P _ T L _ P R I C E _ B Y _ S H I F T   8 0 2  
 # d e f i n e   O B J P R O P _ T L _ S H I F T _ B Y _ P R I C E   8 0 3  
 # d e f i n e   O B J P R O P _ F I B O V A L U E   8 0 4  
 # d e f i n e   O B J P R O P _ F I B O P R I C E V A L U E   8 0 5  
 # d e f i n e   O B J P R O P _ B A R S H I F T 1   8 0 7  
 # d e f i n e   O B J P R O P _ B A R S H I F T 2   8 0 8  
 # d e f i n e   O B J P R O P _ B A R S H I F T 3   8 0 9  
 # d e f i n e   S E L _ C U R R E N T   0  
 # d e f i n e   S E L _ I N I T I A L   1  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   E n u m e r a t i o n s ,   I m p o r t s ,   C o n s t a n t s ,   V a r i a b l e s   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
  
 / / - -  
 / /   E n u m e r a t i o n s   b y   C u s t o m   I n d i c a t o r s  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 / / - -  
 / /   C o n s t a n t s   ( I n p u t   P a r a m e t e r s )  
 i n p u t   d o u b l e   L B   =   1 3 . 0 ; i n p u t   i n t   M a g i c S t a r t   =   9 2 0 9 ;   / /   M a g i c   N u m b e r ,   k i n d   o f . . .  
 c l a s s   c  
 {  
 	 	 p u b l i c :  
 	 s t a t i c   d o u b l e   L B ;  
 	 s t a t i c   i n t   M a g i c S t a r t ;  
 } ;  
 d o u b l e   c : : L B ;  
 i n t   c : : M a g i c S t a r t ;  
  
  
 / / - -  
 / /   V a r i a b l e s   ( G l o b a l   V a r i a b l e s )  
 c l a s s   v  
 {  
 	 	 p u b l i c :  
 	 s t a t i c   d o u b l e   T P ;  
 	 s t a t i c   d o u b l e   S L ;  
 	 s t a t i c   d o u b l e   S E L L _ S L ;  
 	 s t a t i c   d o u b l e   S E L L _ T P ;  
 	 s t a t i c   d o u b l e   T R A I L _ S E L L ;  
 	 s t a t i c   d o u b l e   T C H E C K _ S E L L ;  
 	 s t a t i c   d o u b l e   T R A I L ;  
 	 s t a t i c   d o u b l e   T C H E C K ;  
 	 s t a t i c   d o u b l e   A T R _ T O P ;  
 	 s t a t i c   d o u b l e   A T R _ B O T T O M ;  
 	 s t a t i c   d o u b l e   A T R _ L I N E _ T O P ;  
 	 s t a t i c   d o u b l e   A T R _ L I N E _ B O T T O M ;  
 	 s t a t i c   d o u b l e   A T R _ T P _ L I N E ;  
 	 s t a t i c   d o u b l e   A T R _ S L _ L I N E ;  
 	 s t a t i c   d o u b l e   T C H E C K _ L I N E ;  
 	 s t a t i c   d o u b l e   A T R _ T P _ L I N E _ T O _ T P ;  
 	 s t a t i c   d o u b l e   A T R _ S L _ L I N E _ T O _ S L ;  
 	 s t a t i c   d o u b l e   T C H E C K _ L I N E _ T O _ T C ;  
 	 s t a t i c   d o u b l e   A T R _ S T P _ L I N E _ T O _ T P ;  
 	 s t a t i c   d o u b l e   A T R _ S S L _ L I N E _ T O _ S L ;  
 	 s t a t i c   d o u b l e   T C H E C K _ S _ L I N E _ T O _ T C ;  
 } ;  
 d o u b l e   v : : T P ;  
 d o u b l e   v : : S L ;  
 d o u b l e   v : : S E L L _ S L ;  
 d o u b l e   v : : S E L L _ T P ;  
 d o u b l e   v : : T R A I L _ S E L L ;  
 d o u b l e   v : : T C H E C K _ S E L L ;  
 d o u b l e   v : : T R A I L ;  
 d o u b l e   v : : T C H E C K ;  
 d o u b l e   v : : A T R _ T O P ;  
 d o u b l e   v : : A T R _ B O T T O M ;  
 d o u b l e   v : : A T R _ L I N E _ T O P ;  
 d o u b l e   v : : A T R _ L I N E _ B O T T O M ;  
 d o u b l e   v : : A T R _ T P _ L I N E ;  
 d o u b l e   v : : A T R _ S L _ L I N E ;  
 d o u b l e   v : : T C H E C K _ L I N E ;  
 d o u b l e   v : : A T R _ T P _ L I N E _ T O _ T P ;  
 d o u b l e   v : : A T R _ S L _ L I N E _ T O _ S L ;  
 d o u b l e   v : : T C H E C K _ L I N E _ T O _ T C ;  
 d o u b l e   v : : A T R _ S T P _ L I N E _ T O _ T P ;  
 d o u b l e   v : : A T R _ S S L _ L I N E _ T O _ S L ;  
 d o u b l e   v : : T C H E C K _ S _ L I N E _ T O _ T C ;  
  
  
  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   S y s t e m   g l o b a l   v a r i a b l e s   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 / / - -  
 i n t   F X D _ C U R R E N T _ F U N C T I O N _ I D   =   0 ;  
 d o u b l e   F X D _ M I L S _ I N I T _ E N D         =   0 ;  
 i n t   F X D _ T I C K S _ F R O M _ S T A R T         =   0 ;  
 i n t   F X D _ M O R E _ S H I F T                     =   0 ;  
 b o o l   F X D _ D R A W _ S P R E A D _ I N F O       =   f a l s e ;  
 b o o l   F X D _ F I R S T _ T I C K _ P A S S E D     =   f a l s e ;  
 b o o l   F X D _ B R E A K                             =   f a l s e ;  
 b o o l   F X D _ C O N T I N U E                       =   f a l s e ;  
 b o o l   F X D _ C H A R T _ I S _ O F F L I N E       =   f a l s e ;  
 b o o l   F X D _ O N T I M E R _ T A K E N             =   f a l s e ;  
 b o o l   F X D _ O N T I M E R _ T A K E N _ I N _ M I L L I S E C O N D S   =   f a l s e ;  
 d o u b l e   F X D _ O N T I M E R _ T A K E N _ T I M E   =   0 ;  
 b o o l   U S E _ V I R T U A L _ S T O P S   =   V I R T U A L _ S T O P S _ E N A B L E D ;  
 s t r i n g   F X D _ C U R R E N T _ S Y M B O L       =   " " ;  
 i n t   F X D _ B L O C K S _ C O U N T                 =   8 6 ;  
 d a t e t i m e   F X D _ T I C K S K I P _ U N T I L   =   0 ;  
  
 / / -   f o r   u s e   i n   O n C h a r t ( )   e v e n t  
 s t r u c t   f x d _ o n c h a r t  
 {  
 	 i n t   i d ;  
 	 l o n g   l p a r a m ;  
 	 d o u b l e   d p a r a m ;  
 	 s t r i n g   s p a r a m ;  
 } ;  
 f x d _ o n c h a r t   F X D _ O N C H A R T ;  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / /   |                                                                                                   E V E N T   F U N C T I O N S                                                                                                     |   / /  
 / /   |                                                       T h e s e   a r e   t h e   m a i n   f u n c t i o n s   t h a t   c o n t r o l s   t h e   w h o l e   p r o j e c t                                                       |   / /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   T h i s   f u n c t i o n   i s   e x e c u t e d   o n c e   w h e n   t h e   p r o g r a m   s t a r t s   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 i n t   O n I n i t ( )  
 {  
  
 	 / /   I n i t i a t e   C o n s t a n t s  
 	 c : : L B   =   L B ;  
 	 c : : M a g i c S t a r t   =   M a g i c S t a r t ;  
  
  
  
  
 	 / /   d o   o r   d o   n o t   n o t   i n i t i l i a l i z e   o n   r e l o a d  
 	 i f   ( U n i n i t i a l i z e R e a s o n ( )   ! =   0 )  
 	 {  
 	 	 i f   ( U n i n i t i a l i z e R e a s o n ( )   = =   R E A S O N _ C H A R T C H A N G E )  
 	 	 {  
 	 	 	 / /   i f   t h e   s y m b o l   i s   t h e   s a m e ,   d o   n o t   r e l o a d ,   o t h e r w i s e   c o n t i n u e   b e l o w  
 	 	 	 i f   ( F X D _ C U R R E N T _ S Y M B O L   = =   S y m b o l ( ) )   { r e t u r n   I N I T _ S U C C E E D E D ; }  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 r e t u r n   I N I T _ S U C C E E D E D ;  
 	 	 }  
 	 }  
 	 F X D _ C U R R E N T _ S Y M B O L   =   S y m b o l ( ) ;  
  
 	 C u r r e n t S y m b o l ( F X D _ C U R R E N T _ S Y M B O L ) ;   / /   C u r r e n t S y m b o l ( )   h a s   i n t e r n a l   m e m o r y   t h a t   s h o u l d   b e   s e t   f r o m   h e r e   w h e n   t h e   s y m b o l l   i s   c h a n g e d  
 	 C u r r e n t T i m e f r a m e ( P E R I O D _ C U R R E N T ) ;  
  
 	 v : : T P   =   0 . 0 ;  
 	 v : : S L   =   0 . 0 ;  
 	 v : : S E L L _ S L   =   0 . 0 ;  
 	 v : : S E L L _ T P   =   0 . 0 ;  
 	 v : : T R A I L _ S E L L   =   0 . 0 ;  
 	 v : : T C H E C K _ S E L L   =   0 . 0 ;  
 	 v : : T R A I L   =   0 . 0 ;  
 	 v : : T C H E C K   =   0 . 0 ;  
 	 v : : A T R _ T O P   =   0 . 0 ;  
 	 v : : A T R _ B O T T O M   =   0 . 0 ;  
 	 v : : A T R _ L I N E _ T O P   =   0 . 0 ;  
 	 v : : A T R _ L I N E _ B O T T O M   =   0 . 0 ;  
 	 v : : A T R _ T P _ L I N E   =   0 . 0 ;  
 	 v : : A T R _ S L _ L I N E   =   0 . 0 ;  
 	 v : : T C H E C K _ L I N E   =   0 . 0 ;  
 	 v : : A T R _ T P _ L I N E _ T O _ T P   =   0 . 0 ;  
 	 v : : A T R _ S L _ L I N E _ T O _ S L   =   0 . 0 ;  
 	 v : : T C H E C K _ L I N E _ T O _ T C   =   0 . 0 ;  
 	 v : : A T R _ S T P _ L I N E _ T O _ T P   =   0 . 0 ;  
 	 v : : A T R _ S S L _ L I N E _ T O _ S L   =   0 . 0 ;  
 	 v : : T C H E C K _ S _ L I N E _ T O _ T C   =   0 . 0 ;  
  
  
  
  
 	 C o m m e n t ( " " ) ;  
 	 f o r   ( i n t   i = O b j e c t s T o t a l ( C h a r t I D ( ) ) ;   i > = 0 ;   i - - )  
 	 {  
 	 	 s t r i n g   n a m e   =   O b j e c t N a m e ( C h a r t I D ( ) ,   i ) ;  
 	 	 i f   ( S t r i n g S u b s t r ( n a m e , 0 , 8 )   = =   " f x d _ c m n t " )   { O b j e c t D e l e t e ( C h a r t I D ( ) ,   n a m e ) ; }  
 	 }  
 	 C h a r t R e d r a w ( ) ;  
  
  
  
 	 / / - -   d i s a b l e   v i r t u a l   s t o p s   i n   o p t i m i z a t i o n ,   b e c a u s e   g r a p h i c a l   o b j e c t s   d o e s   n o t   w o r k  
 	 / /   h t t p : / / d o c s . m q l 4 . c o m / r u n t i m e / t e s t i n g  
 	 i f   ( M Q L I n f o I n t e g e r ( M Q L _ O P T I M I Z A T I O N )   | |   ( M Q L I n f o I n t e g e r ( M Q L _ T E S T E R )   & &   ! M Q L I n f o I n t e g e r ( M Q L _ V I S U A L _ M O D E ) ) )   {  
 	 	 U S E _ V I R T U A L _ S T O P S   =   f a l s e ;  
 	 }  
  
 	 / / - -   s e t   i n i t i a l   l o c a l   a n d   s e r v e r   t i m e  
 	 T i m e A t S t a r t ( " s e t " ) ;  
  
 	 / / - -   s e t   i n i t i a l   b a l a n c e  
 	 A c c o u n t B a l a n c e A t S t a r t ( ) ;  
  
 	 / / - -   d r a w   t h e   i n i t i a l   s p r e a d   i n f o   m e t e r  
 	 i f   ( E N A B L E _ S P R E A D _ M E T E R   = =   f a l s e )   {  
 	 	 F X D _ D R A W _ S P R E A D _ I N F O   =   f a l s e ;  
 	 }  
 	 e l s e   {  
 	 	 F X D _ D R A W _ S P R E A D _ I N F O   =   ! ( M Q L I n f o I n t e g e r ( M Q L _ T E S T E R )   & &   ! M Q L I n f o I n t e g e r ( M Q L _ V I S U A L _ M O D E ) ) ;  
 	 }  
 	 i f   ( F X D _ D R A W _ S P R E A D _ I N F O )   D r a w S p r e a d I n f o ( ) ;  
  
 	 / / - -   d r a w   i n i t i a l   s t a t u s  
 	 i f   ( E N A B L E _ S T A T U S )   D r a w S t a t u s ( " w a i t i n g   f o r   t i c k . . . " ) ;  
  
 	 / / - -   d r a w   i n d i c a t o r s   a f t e r   t e s t  
 	 T e s t e r H i d e I n d i c a t o r s ( ! E N A B L E _ T E S T _ I N D I C A T O R S ) ;  
  
 	 / / - -   w o r k i n g   w i t h   o f f l i n e   c h a r t s  
 	 i f   ( M Q L I n f o I n t e g e r ( M Q L _ P R O G R A M _ T Y P E )   = =   P R O G R A M _ E X P E R T )  
 	 {  
 	 	 F X D _ C H A R T _ I S _ O F F L I N E   =   C h a r t G e t I n t e g e r ( 0 ,   C H A R T _ I S _ O F F L I N E ) ;  
 	 }  
  
 	 i f   ( M Q L I n f o I n t e g e r ( M Q L _ P R O G R A M _ T Y P E )   ! =   P R O G R A M _ S C R I P T )  
 	 {  
 	 	 i f   ( F X D _ C H A R T _ I S _ O F F L I N E   = =   t r u e   | |   ( E N A B L E _ E V E N T _ T R A D E   = =   1   & &   O N _ T R A D E _ R E A L T I M E   = =   1 ) )  
 	 	 {  
 	 	 	 F X D _ O N T I M E R _ T A K E N   =   t r u e ;  
 	 	 	 E v e n t S e t M i l l i s e c o n d T i m e r ( 1 ) ;  
 	 	 }  
 	 	 i f   ( E N A B L E _ E V E N T _ T I M E R )   {  
 	 	 	 O n T i m e r S e t ( O N _ T I M E R _ P E R I O D ) ;  
 	 	 }  
 	 }  
  
  
 	 / / - -   I n i t i a l i z e   b l o c k s   c l a s s e s  
 	 A r r a y R e s i z e ( _ b l o c k s _ ,   8 6 ) ;  
  
 	 _ b l o c k s _ [ 0 ]   =   n e w   B l o c k 0 ( ) ;  
 	 _ b l o c k s _ [ 1 ]   =   n e w   B l o c k 1 ( ) ;  
 	 _ b l o c k s _ [ 2 ]   =   n e w   B l o c k 2 ( ) ;  
 	 _ b l o c k s _ [ 3 ]   =   n e w   B l o c k 3 ( ) ;  
 	 _ b l o c k s _ [ 4 ]   =   n e w   B l o c k 4 ( ) ;  
 	 _ b l o c k s _ [ 5 ]   =   n e w   B l o c k 5 ( ) ;  
 	 _ b l o c k s _ [ 6 ]   =   n e w   B l o c k 6 ( ) ;  
 	 _ b l o c k s _ [ 7 ]   =   n e w   B l o c k 7 ( ) ;  
 	 _ b l o c k s _ [ 8 ]   =   n e w   B l o c k 8 ( ) ;  
 	 _ b l o c k s _ [ 9 ]   =   n e w   B l o c k 9 ( ) ;  
 	 _ b l o c k s _ [ 1 0 ]   =   n e w   B l o c k 1 0 ( ) ;  
 	 _ b l o c k s _ [ 1 1 ]   =   n e w   B l o c k 1 1 ( ) ;  
 	 _ b l o c k s _ [ 1 2 ]   =   n e w   B l o c k 1 2 ( ) ;  
 	 _ b l o c k s _ [ 1 3 ]   =   n e w   B l o c k 1 3 ( ) ;  
 	 _ b l o c k s _ [ 1 4 ]   =   n e w   B l o c k 1 4 ( ) ;  
 	 _ b l o c k s _ [ 1 5 ]   =   n e w   B l o c k 1 5 ( ) ;  
 	 _ b l o c k s _ [ 1 6 ]   =   n e w   B l o c k 1 6 ( ) ;  
 	 _ b l o c k s _ [ 1 7 ]   =   n e w   B l o c k 1 7 ( ) ;  
 	 _ b l o c k s _ [ 1 8 ]   =   n e w   B l o c k 1 8 ( ) ;  
 	 _ b l o c k s _ [ 1 9 ]   =   n e w   B l o c k 1 9 ( ) ;  
 	 _ b l o c k s _ [ 2 0 ]   =   n e w   B l o c k 2 0 ( ) ;  
 	 _ b l o c k s _ [ 2 1 ]   =   n e w   B l o c k 2 1 ( ) ;  
 	 _ b l o c k s _ [ 2 2 ]   =   n e w   B l o c k 2 2 ( ) ;  
 	 _ b l o c k s _ [ 2 3 ]   =   n e w   B l o c k 2 3 ( ) ;  
 	 _ b l o c k s _ [ 2 4 ]   =   n e w   B l o c k 2 4 ( ) ;  
 	 _ b l o c k s _ [ 2 5 ]   =   n e w   B l o c k 2 5 ( ) ;  
 	 _ b l o c k s _ [ 2 6 ]   =   n e w   B l o c k 2 6 ( ) ;  
 	 _ b l o c k s _ [ 2 7 ]   =   n e w   B l o c k 2 7 ( ) ;  
 	 _ b l o c k s _ [ 2 8 ]   =   n e w   B l o c k 2 8 ( ) ;  
 	 _ b l o c k s _ [ 2 9 ]   =   n e w   B l o c k 2 9 ( ) ;  
 	 _ b l o c k s _ [ 3 0 ]   =   n e w   B l o c k 3 0 ( ) ;  
 	 _ b l o c k s _ [ 3 1 ]   =   n e w   B l o c k 3 1 ( ) ;  
 	 _ b l o c k s _ [ 3 2 ]   =   n e w   B l o c k 3 2 ( ) ;  
 	 _ b l o c k s _ [ 3 3 ]   =   n e w   B l o c k 3 3 ( ) ;  
 	 _ b l o c k s _ [ 3 4 ]   =   n e w   B l o c k 3 4 ( ) ;  
 	 _ b l o c k s _ [ 3 5 ]   =   n e w   B l o c k 3 5 ( ) ;  
 	 _ b l o c k s _ [ 3 6 ]   =   n e w   B l o c k 3 6 ( ) ;  
 	 _ b l o c k s _ [ 3 7 ]   =   n e w   B l o c k 3 7 ( ) ;  
 	 _ b l o c k s _ [ 3 8 ]   =   n e w   B l o c k 3 8 ( ) ;  
 	 _ b l o c k s _ [ 3 9 ]   =   n e w   B l o c k 3 9 ( ) ;  
 	 _ b l o c k s _ [ 4 0 ]   =   n e w   B l o c k 4 0 ( ) ;  
 	 _ b l o c k s _ [ 4 1 ]   =   n e w   B l o c k 4 1 ( ) ;  
 	 _ b l o c k s _ [ 4 2 ]   =   n e w   B l o c k 4 2 ( ) ;  
 	 _ b l o c k s _ [ 4 3 ]   =   n e w   B l o c k 4 3 ( ) ;  
 	 _ b l o c k s _ [ 4 4 ]   =   n e w   B l o c k 4 4 ( ) ;  
 	 _ b l o c k s _ [ 4 5 ]   =   n e w   B l o c k 4 5 ( ) ;  
 	 _ b l o c k s _ [ 4 6 ]   =   n e w   B l o c k 4 6 ( ) ;  
 	 _ b l o c k s _ [ 4 7 ]   =   n e w   B l o c k 4 7 ( ) ;  
 	 _ b l o c k s _ [ 4 8 ]   =   n e w   B l o c k 4 8 ( ) ;  
 	 _ b l o c k s _ [ 4 9 ]   =   n e w   B l o c k 4 9 ( ) ;  
 	 _ b l o c k s _ [ 5 0 ]   =   n e w   B l o c k 5 0 ( ) ;  
 	 _ b l o c k s _ [ 5 1 ]   =   n e w   B l o c k 5 1 ( ) ;  
 	 _ b l o c k s _ [ 5 2 ]   =   n e w   B l o c k 5 2 ( ) ;  
 	 _ b l o c k s _ [ 5 3 ]   =   n e w   B l o c k 5 3 ( ) ;  
 	 _ b l o c k s _ [ 5 4 ]   =   n e w   B l o c k 5 4 ( ) ;  
 	 _ b l o c k s _ [ 5 5 ]   =   n e w   B l o c k 5 5 ( ) ;  
 	 _ b l o c k s _ [ 5 6 ]   =   n e w   B l o c k 5 6 ( ) ;  
 	 _ b l o c k s _ [ 5 7 ]   =   n e w   B l o c k 5 7 ( ) ;  
 	 _ b l o c k s _ [ 5 8 ]   =   n e w   B l o c k 5 8 ( ) ;  
 	 _ b l o c k s _ [ 5 9 ]   =   n e w   B l o c k 5 9 ( ) ;  
 	 _ b l o c k s _ [ 6 0 ]   =   n e w   B l o c k 6 0 ( ) ;  
 	 _ b l o c k s _ [ 6 1 ]   =   n e w   B l o c k 6 1 ( ) ;  
 	 _ b l o c k s _ [ 6 2 ]   =   n e w   B l o c k 6 2 ( ) ;  
 	 _ b l o c k s _ [ 6 3 ]   =   n e w   B l o c k 6 3 ( ) ;  
 	 _ b l o c k s _ [ 6 4 ]   =   n e w   B l o c k 6 4 ( ) ;  
 	 _ b l o c k s _ [ 6 5 ]   =   n e w   B l o c k 6 5 ( ) ;  
 	 _ b l o c k s _ [ 6 6 ]   =   n e w   B l o c k 6 6 ( ) ;  
 	 _ b l o c k s _ [ 6 7 ]   =   n e w   B l o c k 6 7 ( ) ;  
 	 _ b l o c k s _ [ 6 8 ]   =   n e w   B l o c k 6 8 ( ) ;  
 	 _ b l o c k s _ [ 6 9 ]   =   n e w   B l o c k 6 9 ( ) ;  
 	 _ b l o c k s _ [ 7 0 ]   =   n e w   B l o c k 7 0 ( ) ;  
 	 _ b l o c k s _ [ 7 1 ]   =   n e w   B l o c k 7 1 ( ) ;  
 	 _ b l o c k s _ [ 7 2 ]   =   n e w   B l o c k 7 2 ( ) ;  
 	 _ b l o c k s _ [ 7 3 ]   =   n e w   B l o c k 7 3 ( ) ;  
 	 _ b l o c k s _ [ 7 4 ]   =   n e w   B l o c k 7 4 ( ) ;  
 	 _ b l o c k s _ [ 7 5 ]   =   n e w   B l o c k 7 5 ( ) ;  
 	 _ b l o c k s _ [ 7 6 ]   =   n e w   B l o c k 7 6 ( ) ;  
 	 _ b l o c k s _ [ 7 7 ]   =   n e w   B l o c k 7 7 ( ) ;  
 	 _ b l o c k s _ [ 7 8 ]   =   n e w   B l o c k 7 8 ( ) ;  
 	 _ b l o c k s _ [ 7 9 ]   =   n e w   B l o c k 7 9 ( ) ;  
 	 _ b l o c k s _ [ 8 0 ]   =   n e w   B l o c k 8 0 ( ) ;  
 	 _ b l o c k s _ [ 8 1 ]   =   n e w   B l o c k 8 1 ( ) ;  
 	 _ b l o c k s _ [ 8 2 ]   =   n e w   B l o c k 8 2 ( ) ;  
 	 _ b l o c k s _ [ 8 3 ]   =   n e w   B l o c k 8 3 ( ) ;  
 	 _ b l o c k s _ [ 8 4 ]   =   n e w   B l o c k 8 4 ( ) ;  
 	 _ b l o c k s _ [ 8 5 ]   =   n e w   B l o c k 8 5 ( ) ;  
  
 	 / /   f i l l   t h e   l o o k u p   t a b l e  
 	 A r r a y R e s i z e ( f x d B l o c k s L o o k u p T a b l e ,   A r r a y S i z e ( _ b l o c k s _ ) ) ;  
 	 f o r   ( i n t   i = 0 ;   i < A r r a y S i z e ( _ b l o c k s _ ) ;   i + + )  
 	 {  
 	 	 f x d B l o c k s L o o k u p T a b l e [ i ]   =   _ b l o c k s _ [ i ] . _ _ b l o c k _ u s e r _ n u m b e r ;  
 	 }  
  
 	 / /   f i l l   t h e   l i s t   o f   i n b o u n d   b l o c k s   f o r   e a c h   B l o c k C a l l s   i n s t a n c e  
 	 f o r   ( i n t   i = 0 ;   i < A r r a y S i z e ( _ b l o c k s _ ) ;   i + + )  
 	 {  
 	 	 _ b l o c k s _ [ i ] . _ _ a n n o u n c e T h i s B l o c k ( ) ;  
 	 }  
  
 	 / /   L i s t   o f   i n i t i a l l y   d i s a b l e d   b l o c k s  
 	 i n t   d i s a b l e d _ b l o c k s _ l i s t [ ]   =   { } ;  
 	 f o r   ( i n t   l   =   0 ;   l   <   A r r a y S i z e ( d i s a b l e d _ b l o c k s _ l i s t ) ;   l + + )   {  
 	 	 _ b l o c k s _ [ d i s a b l e d _ b l o c k s _ l i s t [ l ] ] . _ _ d i s a b l e d   =   t r u e ;  
 	 }  
  
  
  
 	 F X D _ M I L S _ I N I T _ E N D           =   ( d o u b l e ) G e t T i c k C o u n t ( ) ;  
 	 F X D _ F I R S T _ T I C K _ P A S S E D   =   f a l s e ;   / /   r e s e t   i s   n e e d e d   w h e n   c h a n g i n g   i n p u t s  
  
 	 r e t u r n ( I N I T _ S U C C E E D E D ) ;  
 }  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   T h i s   f u n c t i o n   i s   e x e c u t e d   o n   e v e r y   i n c o m i n g   t i c k   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 v o i d   O n T i c k ( )  
 {  
 	 F X D _ T I C K S _ F R O M _ S T A R T + + ;  
  
 	 i f   ( E N A B L E _ S T A T U S   & &   F X D _ T I C K S _ F R O M _ S T A R T   = =   1 )   D r a w S t a t u s ( " w o r k i n g " ) ;  
  
 	 / / - -   s p e c i a l   s y s t e m   a c t i o n s  
 	 i f   ( F X D _ D R A W _ S P R E A D _ I N F O )   D r a w S p r e a d I n f o ( ) ;  
 	 T i c k s D a t a ( " " ) ;   / /   C o l l e c t   t i c k s   ( i f   n e e d e d )  
 	 T i c k s P e r S e c o n d ( f a l s e ,   t r u e ) ;   / /   C o l l e c t   t i c k s   p e r   s e c o n d  
 	 i f   ( U S E _ V I R T U A L _ S T O P S )   { V i r t u a l S t o p s D r i v e r ( ) ; }  
  
 	 i f   ( f a l s e )   E x p i r a t i o n W o r k e r   *   e x p i r a t i o n D u m m y   =   n e w   E x p i r a t i o n W o r k e r ( ) ;  
 	 e x p i r a t i o n W o r k e r . R u n ( ) ;  
  
 	 i f   ( O r d e r s T o t a l ( ) )   / /   t h i s   m a k e s   t h i n g s   f a s t e r  
 	 {  
 	 	 O C O D r i v e r ( ) ;   / /   C h e c k   a n d   c l o s e   O C O   o r d e r s  
 	 }  
  
 	 i f   ( E N A B L E _ E V E N T _ T R A D E )   { O n T r a d e ( ) ; }  
  
  
 	 / /   s k i p   t i c k s  
 	 i f   ( T i m e L o c a l ( )   <   F X D _ T I C K S K I P _ U N T I L )   { r e t u r n ; }  
  
 	 / / - -   r u n   b l o c k s  
 	 i n t   b l o c k s _ t o _ r u n [ ]   =   { 0 , 6 1 } ;  
 	 f o r   ( i n t   i = 0 ;   i < A r r a y S i z e ( b l o c k s _ t o _ r u n ) ;   i + + )   {  
 	 	 _ b l o c k s _ [ b l o c k s _ t o _ r u n [ i ] ] . r u n ( ) ;  
 	 }  
  
  
 	 r e t u r n ;  
 }  
  
  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   T h i s   f u n c t i o n   i s   e x e c u t e d   o n   e v e r y   t i c k ,   b e c a u s e   i t ' s   n o t   n a t i v e   f o r   M Q L 4     / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 v o i d   O n T r a d e ( )  
 {  
 	 / /   T h i s   i s   n e e d e d   s o   t h a t   t h e   O n T r a d e E v e n t D e t e c t o r   c l a s s   i s   a d d e d   i n t o   t h e   c o d e  
 	 i f   ( f a l s e )   O n T r a d e E v e n t D e t e c t o r   *   d u m m y   =   n e w   O n T r a d e E v e n t D e t e c t o r ( ) ;  
  
 }  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   T h i s   f u n c t i o n   i s   e x e c u t e d   o n   a   p e r i o d   b a s i s   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 v o i d   O n T i m e r ( )  
 {  
 	 / / - -   t o   s i m u l a t e   t i c k s   i n   o f f l i n e   c h a r t s ,   T i m e r   i s   u s e d   i n s t e a d   o f   i n f i n i t e   l o o p  
 	 / / - -   t h e   n e x t   f u n c t i o n   c h e c k s   f o r   c h a n g e s   i n   p r i c e   a n d   c a l l s   O n T i c k ( )   m a n u a l l y  
 	 i f   ( F X D _ C H A R T _ I S _ O F F L I N E   & &   R e f r e s h R a t e s ( ) )   {  
 	 	 O n T i c k ( ) ;  
 	 }  
 	 i f   ( O N _ T R A D E _ R E A L T I M E   = =   1 )   {  
 	 	 O n T r a d e ( ) ;  
 	 }  
  
 	 s t a t i c   d a t e t i m e   t 0   =   0 ;  
 	 d a t e t i m e   t   =   0 ;  
 	 b o o l   o k   =   f a l s e ;  
  
 	 i f   ( F X D _ O N T I M E R _ T A K E N )  
 	 {  
 	 	 i f   ( F X D _ O N T I M E R _ T A K E N _ T I M E   >   0 )  
 	 	 {  
 	 	 	 i f   ( F X D _ O N T I M E R _ T A K E N _ I N _ M I L L I S E C O N D S   = =   t r u e )  
 	 	 	 {  
 	 	 	 	 t   =   G e t T i c k C o u n t ( ) ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t   =   T i m e L o c a l ( ) ;  
 	 	 	 }  
 	 	 	 i f   ( ( t   -   t 0 )   > =   F X D _ O N T I M E R _ T A K E N _ T I M E )  
 	 	 	 {  
 	 	 	 	 t 0   =   t ;  
 	 	 	 	 o k   =   t r u e ;  
 	 	 	 }  
 	 	 }  
  
 	 	 i f   ( o k   = =   f a l s e )   {  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 }  
  
 }  
  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   T h i s   f u n c t i o n   i s   e x e c u t e d   w h e n   c h a r t   e v e n t   h a p p e n s   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 v o i d   O n C h a r t E v e n t (  
 	 c o n s t   i n t   i d ,                   / /   E v e n t   I D  
 	 c o n s t   l o n g &   l p a r a m ,       / /   P a r a m e t e r   o f   t y p e   l o n g   e v e n t  
 	 c o n s t   d o u b l e &   d p a r a m ,   / /   P a r a m e t e r   o f   t y p e   d o u b l e   e v e n t  
 	 c o n s t   s t r i n g &   s p a r a m     / /   P a r a m e t e r   o f   t y p e   s t r i n g   e v e n t s  
 )  
 {  
 	 / / - -   w r i t e   p a r a m e t e r   t o   t h e   s y s t e m   g l o b a l   v a r i a b l e s  
 	 F X D _ O N C H A R T . i d           =   i d ;  
 	 F X D _ O N C H A R T . l p a r a m   =   l p a r a m ;  
 	 F X D _ O N C H A R T . d p a r a m   =   d p a r a m ;  
 	 F X D _ O N C H A R T . s p a r a m   =   s p a r a m ;  
  
  
 	 r e t u r n ;  
 }  
  
 / / V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V / /  
 / /   T h i s   f u n c t i o n   i s   e x e c u t e d   o n c e   w h e n   t h e   p r o g r a m   e n d s   / /  
 / / ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / /  
 v o i d   O n D e i n i t ( c o n s t   i n t   r e a s o n )  
 {  
 	 i n t   r e s o n   =   U n i n i t i a l i z e R e a s o n ( ) ;  
 	 i f   ( r e s o n   = =   R E A S O N _ C H A R T C H A N G E   | |   r e s o n   = =   R E A S O N _ P A R A M E T E R S   | |   r e a s o n   = =   R E A S O N _ T E M P L A T E )   { r e t u r n ; }  
  
 	 / / - -   i f   T i m e r   w a s   s e t ,   k i l l   i t   h e r e  
 	 E v e n t K i l l T i m e r ( ) ;  
  
 	 i f   ( E N A B L E _ S T A T U S )   D r a w S t a t u s ( " s t o p p e d " ) ;  
 	 i f   ( E N A B L E _ S P R E A D _ M E T E R )   D r a w S p r e a d I n f o ( ) ;  
  
  
  
 	 i f   ( M Q L I n f o I n t e g e r ( M Q L _ T E S T E R ) )   {  
 	 	 P r i n t ( " B a c k t e s t e d   i n   " + D o u b l e T o S t r i n g ( ( G e t T i c k C o u n t ( ) - F X D _ M I L S _ I N I T _ E N D ) / 1 0 0 0 ,   2 ) + "   s e c o n d s " ) ;  
 	 	 d o u b l e   t c   =   G e t T i c k C o u n t ( ) - F X D _ M I L S _ I N I T _ E N D ;  
 	 	 i f   ( t c   >   0 )  
 	 	 {  
 	 	 	 P r i n t ( " A v e r a g e   t i c k s   p e r   s e c o n d :   " + D o u b l e T o S t r i n g ( F X D _ T I C K S _ F R O M _ S T A R T / t c ,   0 ) ) ;  
 	 	 }  
 	 }  
  
 	 i f   ( M Q L I n f o I n t e g e r ( M Q L _ P R O G R A M _ T Y P E )   = =   P R O G R A M _ E X P E R T )  
 	 {  
 	 	 s w i t c h ( U n i n i t i a l i z e R e a s o n ( ) )  
 	 	 {  
 	 	 	 c a s e   R E A S O N _ P R O G R A M           :   P r i n t ( " E x p e r t   A d v i s o r   s e l f   t e r m i n a t e d " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ R E M O V E             :   P r i n t ( " E x p e r t   A d v i s o r   r e m o v e d   f r o m   t h e   c h a r t " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ R E C O M P I L E       :   P r i n t ( " E x p e r t   A d v i s o r   h a s   b e e n   r e c o m p i l e d " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ C H A R T C H A N G E   :   P r i n t ( " S y m b o l   o r   c h a r t   p e r i o d   h a s   b e e n   c h a n g e d " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ C H A R T C L O S E     :   P r i n t ( " C h a r t   h a s   b e e n   c l o s e d " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ P A R A M E T E R S     :   P r i n t ( " I n p u t   p a r a m e t e r s   h a v e   b e e n   c h a n g e d   b y   a   u s e r " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ A C C O U N T           :   P r i n t ( " A n o t h e r   a c c o u n t   h a s   b e e n   a c t i v a t e d   o r   r e c o n n e c t i o n   t o   t h e   t r a d e   s e r v e r   h a s   o c c u r r e d   d u e   t o   c h a n g e s   i n   t h e   a c c o u n t   s e t t i n g s " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ T E M P L A T E         :   P r i n t ( " A   n e w   t e m p l a t e   h a s   b e e n   a p p l i e d " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ I N I T F A I L E D     :   P r i n t ( " O n I n i t ( )   h a n d l e r   h a s   r e t u r n e d   a   n o n z e r o   v a l u e " ) ;   b r e a k ;  
 	 	 	 c a s e   R E A S O N _ C L O S E               :   P r i n t ( " T e r m i n a l   h a s   b e e n   c l o s e d " ) ;   b r e a k ;  
 	 	 }  
 	 }  
  
 	 / /   d e l e t e   d y n a m i c   p o i n t e r s  
 	 f o r   ( i n t   i = 0 ;   i < A r r a y S i z e ( _ b l o c k s _ ) ;   i + + )  
 	 {  
 	 	 d e l e t e   _ b l o c k s _ [ i ] ;  
 	 	 _ b l o c k s _ [ i ]   =   N U L L ;  
 	 }  
 	 A r r a y R e s i z e ( _ b l o c k s _ ,   0 ) ;  
  
 	 r e t u r n ;  
 }  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / /   | 	                                                                                   C l a s s e s   o f   b l o c k s                                                                                                         |   / /  
 / /   |                             C l a s s e s   t h a t   c o n t a i n   t h e   a c t u a l   c o d e   o f   t h e   b l o c k s   a n d   t h e i r   i n p u t   p a r a m e t e r s   a s   w e l l                               |   / /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
 / * *  
 	 T h e   b a s e   c l a s s   f o r   a l l   b l o c k   c a l l s  
       * /  
 c l a s s   B l o c k C a l l s  
 {  
 	 p u b l i c :  
 	 	 b o o l   _ _ d i s a b l e d ;   / /   w h e t h e r   o r   n o t   t h e   b l o c k   i s   d i s a b l e d  
  
 	 	 s t r i n g   _ _ b l o c k _ u s e r _ n u m b e r ;  
                 i n t   _ _ b l o c k _ n u m b e r ;  
 	 	 i n t   _ _ b l o c k _ w a i t i n g ;  
 	 	 i n t   _ _ p a r e n t _ n u m b e r ;  
 	 	 i n t   _ _ i n b o u n d _ b l o c k s [ ] ;  
 	 	 i n t   _ _ o u t b o u n d _ b l o c k s [ ] ;  
  
 	 	 v o i d   _ _ a d d I n b o u n d B l o c k ( i n t   i d   =   0 )   {  
 	 	 	 i n t   s i z e   =   A r r a y S i z e ( _ _ i n b o u n d _ b l o c k s ) ;  
 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + )   {  
 	 	 	 	 i f   ( _ _ i n b o u n d _ b l o c k s [ i ]   = =   i d )   {  
 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 A r r a y R e s i z e ( _ _ i n b o u n d _ b l o c k s ,   s i z e   +   1 ) ;  
 	 	 	 _ _ i n b o u n d _ b l o c k s [ s i z e ]   =   i d ;  
 	 	 }  
  
 	 	 v o i d   B l o c k C a l l s ( )   {  
 	 	 	 _ _ d i s a b l e d                     =   f a l s e ;  
 	 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " " ;  
 	 	 	 _ _ b l o c k _ n u m b e r             =   0 ;  
 	 	 	 _ _ b l o c k _ w a i t i n g           =   0 ;  
 	 	 	 _ _ p a r e n t _ n u m b e r           =   0 ;  
 	 	 }  
  
 	 	 / * *  
 	 	       A n n o u n c e   t h i s   b l o c k   t o   t h e   l i s t   o f   i n b o u n d   c o n n e c t i o n s   o f   a l l   t h e   b l o c k s   t o   w h i c h   t h i s   b l o c k   i s   c o n n e c t e d   t o  
 	 	       * /  
 	 	 v o i d   _ _ a n n o u n c e T h i s B l o c k ( )  
 	 	 {  
 	 	       / /   a d d   t h e   c u r r e n t   b l o c k   n u m b e r   t o   t h e   l i s t   o f   i n b o u n d   b l o c k s  
 	 	       / /   f o r   e a c h   o u t b o u n d   b l o c k   t h a t   i s   p r o v i d e d  
 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   A r r a y S i z e ( _ _ o u t b o u n d _ b l o c k s ) ;   i + + )  
 	 	 	 {  
 	 	 	 	 i n t   b l o c k   =   _ _ o u t b o u n d _ b l o c k s [ i ] ;   / /   o u t b o u n d   b l o c k   n u m b e r  
 	 	 	 	 i n t   s i z e     =   A r r a y S i z e ( _ b l o c k s _ [ b l o c k ] . _ _ i n b o u n d _ b l o c k s ) ;   / /   t h e   s i z e   o f   i t s   i n b o u n d   l i s t  
  
 	 	 	 	 / /   s k i p   i f   t h e   c u r r e n t   b l o c k   w a s   a l r e a d y   a d d e d  
 	 	 	 	 f o r   ( i n t   j   =   0 ;   j   <   s i z e ;   j + + )   {  
 	 	 	 	 	 i f   ( _ b l o c k s _ [ b l o c k ] . _ _ i n b o u n d _ b l o c k s [ j ]   = =   _ _ b l o c k _ n u m b e r )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
  
 	 	 	 	 / /   a d d   t h e   c u r r e n t   b l o c k   n u m b e r   t o   t h e   l i s t   o f   i n b o u n d   b l o c k s   o f   t h e   o t h e r   b l o c k  
 	 	 	 	 A r r a y R e s i z e ( _ b l o c k s _ [ b l o c k ] . _ _ i n b o u n d _ b l o c k s ,   s i z e   +   1 ) ;  
 	 	 	 	 _ b l o c k s _ [ b l o c k ] . _ _ i n b o u n d _ b l o c k s [ s i z e ]   =   _ _ b l o c k _ n u m b e r ;  
 	 	 	 }  
 	 	 }  
  
 	 	 / /   t h i s   i s   h e r e ,   b e c a u s e   i t   i s   u s e d   i n   t h e   " r u n "   f u n c t i o n  
 	 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )   =   0 ;  
  
 	 	 / * *  
 	 	 	 I n   t h e   d e r i v e d   c l a s s   t h i s   m e t h o d   s h o u l d   b e   u s e d   t o   s e t   d y n a m i c   p a r a m e t e r s   o r   o t h e r   s t u f f   b e f o r e   t h e   m a i n   e x e c u t e .  
 	 	 	 T h i s   m e t h o d   i s   a u t o m a t i c a l l y   c a l l e d   w i t h i n   t h e   m a i n   " r u n "   m e t h o d   b e l o w ,   b e f o r e   t h e   e x e c u t i o n   o f   t h e   m a i n   c l a s s .  
 	 	 	 * /  
 	 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )   { r e t u r n ; } ;  
 	 	 b o o l   _ b e f o r e E x e c u t e E n a b l e d ;   / /   f o r   s p e e d  
  
 	 	 / * *  
 	 	 	 S a m e   a s   _ b e f o r e E x e c u t e _ ,   b u t   t o   w o r k   a f t e r   t h e   e x e c u t e   m e t h o d .  
 	 	 	 * /  
 	 	 v i r t u a l   v o i d   _ a f t e r E x e c u t e _ ( )   { r e t u r n ; } ;  
 	 	 b o o l   _ a f t e r E x e c u t e E n a b l e d ;   / /   f o r   s p e e d  
  
 	 	 / * *  
 	 	 	 T h i s   i s   t h e   m e t h o d   t h a t   i s   u s e d   t o   r u n   t h e   b l o c k  
 	 	 	 * /  
 	 	 v i r t u a l   v o i d   r u n ( i n t   _ p a r e n t _ = 0 )   {  
 	 	 	 _ _ p a r e n t _ n u m b e r   =   _ p a r e n t _ ;  
 	 	 	 i f   ( _ _ d i s a b l e d   | |   F X D _ B R E A K )   { r e t u r n ; }  
 	 	 	 F X D _ C U R R E N T _ F U N C T I O N _ I D   =   _ _ b l o c k _ n u m b e r ;  
  
 	 	 	 i f   ( _ b e f o r e E x e c u t e E n a b l e d )   { _ b e f o r e E x e c u t e _ ( ) ; }  
 	 	 	 _ e x e c u t e _ ( ) ;  
 	 	 	 i f   ( _ a f t e r E x e c u t e E n a b l e d )   { _ a f t e r E x e c u t e _ ( ) ; }  
  
 	 	 	 i f   ( _ _ b l o c k _ w a i t i n g   & &   F X D _ C U R R E N T _ F U N C T I O N _ I D   = =   _ _ b l o c k _ n u m b e r )   { f x d W a i t . A c c u m u l a t e ( F X D _ C U R R E N T _ F U N C T I O N _ I D ) ; }  
 	 	 }  
 } ;  
  
 B l o c k C a l l s   * _ b l o c k s _ [ ] ;  
  
  
 / /   " P a s s "   m o d e l  
 c l a s s   M D L _ P a s s :   p u b l i c   B l o c k C a l l s  
 {  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " T r a i l i n g   s t o p   ( e a c h   t r a d e ) "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   T 7 , t y p e n a m e   T 8 , t y p e n a m e   T 9 , t y p e n a m e   T 1 0 , t y p e n a m e   T 1 1 , t y p e n a m e   T 1 2 , t y p e n a m e   T 1 3 , t y p e n a m e   T 1 4 , t y p e n a m e   _ T 1 4 _ , t y p e n a m e   T 1 5 , t y p e n a m e   _ T 1 5 _ , t y p e n a m e   T 1 6 , t y p e n a m e   T 1 7 , t y p e n a m e   T 1 8 , t y p e n a m e   T 1 9 , t y p e n a m e   T 2 0 , t y p e n a m e   T 2 1 , t y p e n a m e   T 2 2 , t y p e n a m e   T 2 3 , t y p e n a m e   T 2 4 , t y p e n a m e   _ T 2 4 _ , t y p e n a m e   T 2 5 , t y p e n a m e   _ T 2 5 _ , t y p e n a m e   T 2 6 , t y p e n a m e   T 2 7 , t y p e n a m e   T 2 8 , t y p e n a m e   T 2 9 , t y p e n a m e   _ T 2 9 _ , t y p e n a m e   T 3 0 >  
 c l a s s   M D L _ T r a i l i n g S t o p 2 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   G r o u p M o d e ;  
 	 T 2   G r o u p ;  
 	 T 3   S y m b o l M o d e ;  
 	 T 4   S y m b o l ;  
 	 T 5   B u y s O r S e l l s ;  
 	 T 6   T r a i l W h a t ;  
 	 T 7   T r a i l i n g R e f e r e n c e P r i c e ;  
 	 T 8   T r a i l i n g S t o p M o d e ;  
 	 T 9   t S t o p P i p s ;  
 	 T 1 0   t S t o p M o n e y ;  
 	 T 1 1   t S t o p M u l t i p l e ;  
 	 T 1 2   t S t o p P e r c e n t T P ;  
 	 T 1 3   t S t o p P e r c e n t P r o f i t ;  
 	 T 1 4   f t S t o p ;   v i r t u a l   _ T 1 4 _   _ f t S t o p _ ( ) { r e t u r n ( _ T 1 4 _ ) 0 ; }  
 	 T 1 5   f t D i g i t s ;   v i r t u a l   _ T 1 5 _   _ f t D i g i t s _ ( ) { r e t u r n ( _ T 1 5 _ ) 0 ; }  
 	 T 1 6   T r a i l i n g S t e p M o d e ;  
 	 T 1 7   t S t e p P i p s ;  
 	 T 1 8   t S t e p P e r c e n t T S ;  
 	 T 1 9   T r a i l i n g S t a r t M o d e ;  
 	 T 2 0   t S t a r t P i p s ;  
 	 T 2 1   t S t a r t P e r c e n t T S ;  
 	 T 2 2   t S t a r t P e r c e n t S L ;  
 	 T 2 3   t S t a r t P e r c e n t T P ;  
 	 T 2 4   f t S t a r t ;   v i r t u a l   _ T 2 4 _   _ f t S t a r t _ ( ) { r e t u r n ( _ T 2 4 _ ) 0 ; }  
 	 T 2 5   f t S t a r t F r a c t i o n ;   v i r t u a l   _ T 2 5 _   _ f t S t a r t F r a c t i o n _ ( ) { r e t u r n ( _ T 2 5 _ ) 0 ; }  
 	 T 2 6   T r a i l i n g T P m o d e ;  
 	 T 2 7   t T P p i p s ;  
 	 T 2 8   t T P p e r c e n t T S ;  
 	 T 2 9   f t T P ;   v i r t u a l   _ T 2 9 _   _ f t T P _ ( ) { r e t u r n ( _ T 2 9 _ ) 0 ; }  
 	 T 3 0   L e v e l C o l o r ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ T r a i l i n g S t o p 2 ( )  
 	 {  
 	 	 G r o u p M o d e   =   ( s t r i n g ) " g r o u p " ;  
 	 	 G r o u p   =   ( s t r i n g ) " " ;  
 	 	 S y m b o l M o d e   =   ( s t r i n g ) " s y m b o l " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 B u y s O r S e l l s   =   ( s t r i n g ) " b o t h " ;  
 	 	 T r a i l W h a t   =   ( i n t ) 1 ;  
 	 	 T r a i l i n g R e f e r e n c e P r i c e   =   ( i n t ) 0 ;  
 	 	 T r a i l i n g S t o p M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 t S t o p P i p s   =   ( d o u b l e ) 4 0 . 0 ;  
 	 	 t S t o p M o n e y   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 t S t o p M u l t i p l e   =   ( s t r i n g ) " 2 0 / 5 ,   3 0 / 1 0 " ;  
 	 	 t S t o p P e r c e n t T P   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 t S t o p P e r c e n t P r o f i t   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 T r a i l i n g S t e p M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 t S t e p P i p s   =   ( d o u b l e ) 1 . 0 ;  
 	 	 t S t e p P e r c e n t T S   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 T r a i l i n g S t a r t M o d e   =   ( s t r i n g ) " n o n e " ;  
 	 	 t S t a r t P i p s   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 t S t a r t P e r c e n t T S   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 t S t a r t P e r c e n t S L   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 t S t a r t P e r c e n t T P   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 T r a i l i n g T P m o d e   =   ( s t r i n g ) " n o n e " ;  
 	 	 t T P p i p s   =   ( d o u b l e ) 2 0 . 0 ;  
 	 	 t T P p e r c e n t T S   =   ( d o u b l e ) 2 0 0 . 0 ;  
 	 	 L e v e l C o l o r   =   ( c o l o r ) c l r D e e p P i n k ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 i n t   t o t a l   =   T r a d e s T o t a l ( ) ;  
 	 	  
 	 	 f o r   ( i n t   i n d e x   =   0 ;   i n d e x   <   t o t a l ;   i n d e x + + )  
 	 	 {  
 	 	 	 i f   ( T r a d e S e l e c t B y I n d e x ( i n d e x ,   G r o u p M o d e ,   G r o u p ,   S y m b o l M o d e ,   S y m b o l ,   B u y s O r S e l l s ) )  
 	 	 	 {  
 	 	 	 	 s t r i n g   s y m b o l           =   O r d e r S y m b o l ( ) ;  
 	 	 	 	 d o u b l e   a s k                 =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ;  
 	 	 	 	 d o u b l e   b i d                 =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ;  
 	 	 	 	 d o u b l e   s t o p s l e v e l   =   ( d o u b l e ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ T R A D E _ S T O P S _ L E V E L ) ;  
 	 	 	 	 i n t   d i g i t s                 =   ( i n t ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ D I G I T S ) ;  
 	 	 	 	 i n t   p o l a r i t y             =   1 ;       / /   1   =   b u y ,   - 1   =   s e l l  
 	 	 	 	 d o u b l e   a s k b i d           =   a s k ;   / /   c o u l d   b e   A s k   o r   B i d  
 	 	 	 	 d o u b l e   b i d a s k           =   b i d ;   / /   t h e   o p p o s i t e   o f   a s k b i d  
 	 	 	 	 d o u b l e   s l t p               =   0 ;       / /   c o u l d   b e   S L   o r   T P  
 	 	 	 	 d o u b l e   t p s l               =   0 ;       / /   t h e   o p p o s i t e   o f   s l t p  
 	 	 	 	 d o u b l e   f s l                 =   0 ;       / /   F r e e z e   L e v e l  
 	 	 	 	 d o u b l e   l i m i t             =   0 ;  
 	 	 	 	 d o u b l e   t _ s t o p           =   0 ;       / /   t r a i l i n g   S T O P  
 	 	 	 	 d o u b l e   t _ s t a r t         =   0 ;       / /   t r a i l i n g   S T A R T  
 	 	 	 	 d o u b l e   t _ s t e p           =   0 ;       / /   t r a i l i n g   S T E P  
 	 	 	 	 d o u b l e   t _ o p p             =   0 ;       / /   t r a i l i n g   O p p o s i t e   ( T P   w h e n   t r a i l i n g   S L   o r   S L   w h e n   t r a i l i n g   T P )  
 	 	  
 	 	 	 	 i f   ( T r a i l W h a t   >   0 )   {  
 	 	 	 	 	 s l t p   =   a t t r S t o p L o s s ( ) ;  
 	 	 	 	 	 t p s l   =   a t t r T a k e P r o f i t ( ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 s l t p   =   a t t r T a k e P r o f i t ( ) ;  
 	 	 	 	 	 t p s l   =   a t t r S t o p L o s s ( ) ;  
 	 	 	 	 }  
 	 	  
 	 	 	 	 i f   ( O r d e r T y p e ( )   = =   0 )   {  
 	 	 	 	 	 p o l a r i t y   =   1 ;  
 	 	  
 	 	 	 	 	 i f   ( T r a i l i n g R e f e r e n c e P r i c e   = =   1 )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 a s k b i d   =   b i d ;  
 	 	 	 	 	 	 b i d a s k   =   a s k ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 e l s e   i f   ( O r d e r T y p e ( )   = =   1 )   {  
 	 	 	 	 	 p o l a r i t y   =   - 1 ;  
 	 	 	 	 	 a s k b i d       =   b i d ;  
 	 	 	 	 	 b i d a s k       =   a s k ;  
 	 	  
 	 	 	 	 	 i f   ( T r a i l i n g R e f e r e n c e P r i c e   = =   1 )   {  
 	 	 	 	 	 	 a s k b i d   =   a s k ;  
 	 	 	 	 	 	 b i d a s k   =   b i d ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 i f   ( T r a i l i n g R e f e r e n c e P r i c e   = =   2 )   {  
 	 	 	 	 	 a s k b i d   =   ( a s k   +   b i d )   /   2 ;  
 	 	 	 	 	 b i d a s k   =   ( a s k   +   b i d )   /   2 ;  
 	 	 	 	 }  
 	 	  
 	 	 	 	 / /   T r a i l i n g   S t o p   S i z e  
 	 	 	 	           i f   ( T r a i l i n g S t o p M o d e   = =   " f i x e d " )                   { t _ s t o p   =   t o D i g i t s ( t S t o p P i p s ,   s y m b o l ) ; }    
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t o p M o d e   = =   " p e r c e n t T P " )           { t _ s t o p   =   ( M a t h A b s ( O r d e r O p e n P r i c e ( )   -   t p s l ) )   *   ( t S t o p P e r c e n t T P   /   1 0 0 ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t o p M o d e   = =   " p e r c e n t P r o f i t " )   { t _ s t o p   =   ( M a t h A b s ( a s k b i d   -   O r d e r O p e n P r i c e ( ) ) )   *   ( t S t o p P e r c e n t P r o f i t   /   1 0 0 ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t o p M o d e   = =   " d y n a m i c S i z e " )       { t _ s t o p   =   t o D i g i t s ( _ f t S t o p _ ( ) ,   s y m b o l ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t o p M o d e   = =   " d y n a m i c D i g i t s " )   { t _ s t o p   =   _ f t D i g i t s _ ( ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t o p M o d e   = =   " d y n a m i c " )  
 	 	 	 	 {  
 	 	 	 	 	 / /   T O D O :   f t S t o p   i s   n o w   u s e d   f o r   b o t h ,   d y n a m i c   a n d   d y n a m i c S i z e   -   s e p a r a t e   i t  
 	 	 	 	 	 t _ s t o p   =   _ f t S t o p _ ( ) ;  
 	 	 	 	 	 t _ s t o p   =   ( p o l a r i t y   = =   1 )   ?   a s k   -   t _ s t o p   :   t _ s t o p   -   b i d ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t o p M o d e   = =   " m o n e y " )  
 	 	 	 	 {  
 	 	 	 	 	 t _ s t o p   =   t S t o p M o n e y ;  
 	 	  
 	 	 	 	 	 d o u b l e   l o t s i z e       =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ T R A D E _ C O N T R A C T _ S I Z E ) ;  
 	 	 	 	 	 d o u b l e   t i c k v a l u e   =   ( S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ T R A D E _ T I C K _ V A L U E )   /   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ T R A D E _ T I C K _ S I Z E ) )   *   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ;  
 	 	 	 	 	 t _ s t o p   =   t _ s t o p   /     ( O r d e r L o t s ( )   *   P i p V a l u e ( s y m b o l ) ) ;  
 	 	 	 	 	 / /   T O D O :   r e m o v e   t h i s   t o D i g i t s ( ) ,   t h e   c a l c u l a t i o n   s h o u l d   b e   m a d e   d i r e c t l y   i n t o   d i g i t s  
 	 	 	 	 	 t _ s t o p   =   t o D i g i t s ( t _ s t o p   /   t i c k v a l u e ,   s y m b o l ) ;  
 	 	 	 	 }  
 	 	  
 	 	 	 	 / /   T r a i l i n g   S t a r t   L e v e l  
 	 	 	 	           i f   ( T r a i l i n g S t a r t M o d e   = =   " n o n e " )                           { t _ s t a r t   =   - E M P T Y _ V A L U E ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t a r t M o d e   = =   " z e r o " )                           { t _ s t a r t   =   0 ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t a r t M o d e   = =   " f i x e d " )                         { t _ s t a r t   =   t o D i g i t s ( t S t a r t P i p s ,   s y m b o l ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t a r t M o d e   = =   " p e r c e n t T S " )                 { t _ s t a r t   =   t _ s t o p   *   ( t S t a r t P e r c e n t T S   /   1 0 0 ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t a r t M o d e   = =   " p e r c e n t T P " )                 { t _ s t a r t   =   ( M a t h A b s ( O r d e r O p e n P r i c e ( )   -   t p s l ) )   *   ( t S t a r t P e r c e n t T P   /   1 0 0 ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t a r t M o d e   = =   " p e r c e n t S L " )                 { t _ s t a r t   =   ( M a t h A b s ( O r d e r O p e n P r i c e ( )   -   s l t p ) )   *   ( t S t a r t P e r c e n t S L   /   1 0 0 ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t a r t M o d e   = =   " f u n c t i o n " )                   { t _ s t a r t   =   t o D i g i t s ( _ f t S t a r t _ ( ) ,   s y m b o l ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t a r t M o d e   = =   " f u n c t i o n F r a c t i o n " )   { t _ s t a r t   =   _ f t S t a r t F r a c t i o n _ ( ) ; }  
 	 	  
 	 	 	 	 / /   T r a i l i n g   S t e p   S i z e  
 	 	 	 	           i f   ( T r a i l i n g S t e p M o d e   = =   " f i x e d " )           { t _ s t e p   =   t o D i g i t s ( t S t e p P i p s ,   s y m b o l ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g S t e p M o d e   = =   " p e r c e n t T S " )   { t _ s t e p   =   t _ s t o p   *   ( t S t e p P e r c e n t T S   /   1 0 0 ) ; }  
 	 	  
 	 	 	 	 / /   T r a i l i n g   O p p o s i t e   S i z e  
 	 	 	 	           i f   ( T r a i l i n g T P m o d e   = =   " n o n e " )             { t _ o p p   =   t p s l ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g T P m o d e   = =   " c l e a r " )           { t _ o p p   =   0 ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g T P m o d e   = =   " f i x e d " )           { t _ o p p   =   T r a i l W h a t   *   ( O r d e r O p e n P r i c e ( )   +   ( p o l a r i t y   *   t o D i g i t s ( t T P p i p s ,   s y m b o l ) ) ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g T P m o d e   = =   " p e r c e n t T S " )   { t _ o p p   =   T r a i l W h a t   *   ( O r d e r O p e n P r i c e ( )   +   ( p o l a r i t y   *   t o D i g i t s ( t _ s t o p   *   ( t T P p e r c e n t T S   /   1 0 0 ) ,   s y m b o l ) ) ) ; }  
 	 	 	 	 e l s e   i f   ( T r a i l i n g T P m o d e   = =   " f u n c t i o n " )     { t _ o p p   =   _ f t T P _ ( ) ; }  
 	 	  
 	 	 	 	 / /   t h i s   m o d e   i s   l o c a t e d   h e r e   b e c a u s e   i t   o v e r r i d e s   S t a r t ,   S t o p   a n d   S t e p  
 	 	 	 	 / /   t h e   i d e a   h e r e   i s   t o   u s e   S t a r t   a s   t a r g e t   p r o f i t s  
 	 	 	 	 i f   ( T r a i l i n g S t o p M o d e   = =   " m u l t i p l e " )  
 	 	 	 	 {  
 	 	 	 	 	 b o o l   n e x t   =   f a l s e ;  
 	 	 	 	 	 s t r i n g   t m p 1 [ ] ;  
 	 	 	 	 	 s t r i n g   t m p 2 [ ] ;  
 	 	  
 	 	 	 	 	 S t r i n g E x p l o d e ( " , " ,   t S t o p M u l t i p l e ,   t m p 1 ) ;  
 	 	  
 	 	 	 	 	 f o r   ( i n t   i   =   A r r a y S i z e ( t m p 1 ) - 1 ;   i   > =   0 ;   i - - )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 S t r i n g E x p l o d e ( " / " ,   t m p 1 [ i ] ,   t m p 2 ) ;  
 	 	  
 	 	 	 	 	 	 i f   ( A r r a y S i z e ( t m p 2 )   ! =   2 )   { c o n t i n u e ; }  
 	 	  
 	 	 	 	 	 	 / /   t r a i l i n g   s t a r t   w i l l   b e   u s e d   a s   t h e   t r e s h o l d   l e v e l  
 	 	 	 	 	 	 d o u b l e   n e w _ s t a r t   =   t o D i g i t s ( S t r i n g T o D o u b l e ( S t r i n g T r i m ( t m p 2 [ 0 ] ) ) ,   s y m b o l ) ;  
 	 	  
 	 	 	 	 	 	 / /   t h e   r e g u l a r   t r a i l i n g   s t a r t   i s   b i g g e r   t h a n   t h i s   l e v e l   - >   s k i p  
 	 	 	 	 	 	 i f   ( n e w _ s t a r t   <   t _ s t a r t )   { c o n t i n u e ; }  
 	 	  
 	 	 	 	 	 	 / /   c h e c k   w h e t h e r   t h e   c u r r e n t   p r i c e < - > o p   d i s t a n c e   i s   b i g g e r   t h a n   s o m e   o f   t h e   d e s i r e d   l e v e l s  
 	 	 	 	 	 	 d o u b l e   d i f f   =   N o r m a l i z e D o u b l e ( a s k b i d   -   O r d e r O p e n P r i c e ( ) ,   d i g i t s ) ;  
 	 	  
 	 	 	 	 	 	 i f   ( p o l a r i t y   *   T r a i l W h a t   *   d i f f   > =   n e w _ s t a r t )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 / /   a n d   s e t u p   p a r a m e t e r s   s o   S L   w i l l   b e   m o v e d  
 	 	 	 	 	 	 	 t _ s t a r t   =   n e w _ s t a r t ;  
 	 	 	 	 	 	 	 t _ s t o p     =   p o l a r i t y   *   T r a i l W h a t   *   d i f f   -   t o D i g i t s ( S t r i n g T o D o u b l e ( S t r i n g T r i m ( t m p 2 [ 1 ] ) ) ,   s y m b o l ) ;  
 	 	  
 	 	 	 	 	 	 	 n e x t   =   t r u e ;  
 	 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	  
 	 	 	 	 	 i f   ( n e x t   = =   f a l s e )   { c o n t i n u e ; }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 s t o p s l e v e l       =   s t o p s l e v e l   *   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ;  
 	 	  
 	 	 	 	 i f   ( t _ s t o p   < =   0 )   { c o n t i n u e ; }  
 	 	  
 	 	 	 	 i f   ( O r d e r T y p e ( )   = =   0   & &   T r a i l W h a t   *   ( a s k b i d   -   O r d e r O p e n P r i c e ( ) )   >   t _ s t a r t )  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( ( T r a i l W h a t   *   ( a s k b i d   -   s l t p )   > =   t _ s t o p   +   t _ s t e p )   | |   s l t p   = =   0 )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 / /   c o n s i d e r   m i n i m u m   s t o p  
 	 	 	 	 	 	 f s l       =   M a t h A b s ( a s k b i d   -   t _ s t o p ) ;  
 	 	 	 	 	 	 l i m i t   =   b i d a s k   -   s t o p s l e v e l   *   T r a i l W h a t ;  
 	 	  
 	 	 	 	 	 	 i f   ( f s l   >   l i m i t )   { f s l   =   l i m i t ; }  
 	 	  
 	 	 	 	 	 	 i f   ( T r a i l W h a t   = =   1 )   / /   t r a i l   S L  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 i f   ( s l t p   = =   0   | |   s l t p   <   f s l )   {  
 	 	 	 	 	 	 	 	 M o d i f y S t o p s ( O r d e r T i c k e t ( ) ,   a s k b i d   -   t _ s t o p ,   t _ o p p ,   L e v e l C o l o r ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e   {   / /   t r a i l   T P  
 	 	 	 	 	 	 	 i f   ( s l t p   = =   0   | |   s l t p   >   f s l )   {  
 	 	 	 	 	 	 	 	 M o d i f y S t o p s ( O r d e r T i c k e t ( ) ,   t _ o p p ,   a s k b i d   +   t _ s t o p ,   L e v e l C o l o r ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 e l s e   i f   ( O r d e r T y p e ( )   = =   1   & &   T r a i l W h a t   *   ( O r d e r O p e n P r i c e ( )   -   a s k b i d )   >   t _ s t a r t )  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( ( T r a i l W h a t   *   ( s l t p   -   a s k b i d )   > =   t _ s t o p   +   t _ s t e p )   | |   s l t p   = =   0 )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 / /   c o n s i d e r   m i n i m u m   s t o p  
 	 	 	 	 	 	 f s l       =   M a t h A b s ( a s k b i d   +   t _ s t o p ) ;  
 	 	 	 	 	 	 l i m i t   =   b i d a s k   +   s t o p s l e v e l   *   T r a i l W h a t ;  
 	 	  
 	 	 	 	 	 	 i f   ( f s l   <   l i m i t )   { f s l   =   l i m i t ; }  
 	 	  
 	 	 	 	 	 	 i f   ( T r a i l W h a t   = =   1 )  
 	 	 	 	 	 	 {   / /   t r a i l   S L  
 	 	 	 	 	 	 	 i f   ( s l t p   = =   0   | |   s l t p   >   f s l )  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 M o d i f y S t o p s ( O r d e r T i c k e t ( ) ,   a s k b i d   +   t _ s t o p ,   t _ o p p ,   L e v e l C o l o r ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 {   / /   t r a i l   T P  
 	 	 	 	 	 	 	 i f   ( s l t p   = =   0   | |   s l t p   <   f s l )  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 M o d i f y S t o p s ( O r d e r T i c k e t ( ) ,   t _ o p p ,   a s k b i d   -   t _ s t o p ,   L e v e l C o l o r ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " B r e a k   e v e n   p o i n t   ( e a c h   t r a d e ) "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   T 7 , t y p e n a m e   T 8 , t y p e n a m e   T 9 , t y p e n a m e   T 1 0 , t y p e n a m e   T 1 1 >  
 c l a s s   M D L _ B r e a k E v e n P o i n t :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   G r o u p M o d e ;  
 	 T 2   G r o u p ;  
 	 T 3   S y m b o l M o d e ;  
 	 T 4   S y m b o l ;  
 	 T 5   B u y s O r S e l l s ;  
 	 T 6   O n P r o f i t M o d e ;  
 	 T 7   O n P r o f i t P i p s ;  
 	 T 8   O n P r o f i t P e r c e n t S L ;  
 	 T 9   O n P r o f i t P e r c e n t T P ;  
 	 T 1 0   B E o f f s e t M o d e ;  
 	 T 1 1   B E P o f f s e t P i p s ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ B r e a k E v e n P o i n t ( )  
 	 {  
 	 	 G r o u p M o d e   =   ( s t r i n g ) " g r o u p " ;  
 	 	 G r o u p   =   ( s t r i n g ) " " ;  
 	 	 S y m b o l M o d e   =   ( s t r i n g ) " s y m b o l " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 B u y s O r S e l l s   =   ( s t r i n g ) " b o t h " ;  
 	 	 O n P r o f i t M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 O n P r o f i t P i p s   =   ( d o u b l e ) 1 5 . 0 ;  
 	 	 O n P r o f i t P e r c e n t S L   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 O n P r o f i t P e r c e n t T P   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 B E o f f s e t M o d e   =   ( s t r i n g ) " n o n e " ;  
 	 	 B E P o f f s e t P i p s   =   ( d o u b l e ) 0 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 f o r   ( i n t   i n d e x   =   T r a d e s T o t a l ( ) - 1 ;   i n d e x   > =   0 ;   i n d e x - - )  
 	 	 {  
 	 	 	 i f   ( ! T r a d e S e l e c t B y I n d e x ( i n d e x , G r o u p M o d e , G r o u p ,   S y m b o l M o d e , S y m b o l ,   B u y s O r S e l l s ) )   { c o n t i n u e ; }  
 	 	 	  
 	 	 	 s t r i n g   s y m b o l       =   O r d e r S y m b o l ( ) ;  
 	 	 	 d o u b l e   d i s t a n c e   =   0 ;  
 	 	  
 	 	 	           i f   ( O n P r o f i t M o d e   = =   " f i x e d " )           { d i s t a n c e   =   t o D i g i t s ( O n P r o f i t P i p s , s y m b o l ) ; }  
 	 	 	 e l s e   i f   ( O n P r o f i t M o d e   = =   " p e r c e n t S L " )   { d i s t a n c e   =   M a t h A b s ( O r d e r O p e n P r i c e ( ) - a t t r S t o p L o s s ( ) ) * O n P r o f i t P e r c e n t S L / 1 0 0 ; }  
 	 	 	 e l s e   i f   ( O n P r o f i t M o d e   = =   " p e r c e n t T P " )   { d i s t a n c e   =   M a t h A b s ( O r d e r O p e n P r i c e ( ) - a t t r T a k e P r o f i t ( ) ) * O n P r o f i t P e r c e n t T P / 1 0 0 ; }  
 	 	  
 	 	 	 i f   (  
 	 	 	 	       ( O r d e r T y p e ( )   = =   0   & &   ( S y m b o l I n f o D o u b l e ( s y m b o l , S Y M B O L _ A S K ) - O r d e r O p e n P r i c e ( )   >   d i s t a n c e )   & &   ( a t t r S t o p L o s s ( )   <   O r d e r O p e n P r i c e ( ) ) )  
 	 	 	 	 | |   ( O r d e r T y p e ( )   = =   1   & &   ( O r d e r O p e n P r i c e ( ) - S y m b o l I n f o D o u b l e ( s y m b o l , S Y M B O L _ B I D )   >   d i s t a n c e )   & &   ( ( a t t r S t o p L o s s ( )   >   O r d e r O p e n P r i c e ( ) )   | |   a t t r S t o p L o s s ( )   = =   0 ) )  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 d o u b l e   b e _ o f f s e t   =   0 ;  
 	 	  
 	 	 	 	 i f   ( B E o f f s e t M o d e   = =   " p i p s " )  
 	 	 	 	 {  
 	 	 	 	 	 b e _ o f f s e t   =   t o D i g i t s ( B E P o f f s e t P i p s , s y m b o l ) ;  
 	 	  
 	 	 	 	 	 i f   ( O r d e r T y p e ( )   = =   1 )   { b e _ o f f s e t   =   b e _ o f f s e t * ( - 1 ) ; }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 M o d i f y S t o p s ( O r d e r T i c k e t ( ) ,   O r d e r O p e n P r i c e ( ) + b e _ o f f s e t ,   a t t r T a k e P r o f i t ( ) ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " M o d i f y   V a r i a b l e s "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   _ T 2 _ , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   _ T 4 _ , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   _ T 6 _ , t y p e n a m e   T 7 , t y p e n a m e   T 8 , t y p e n a m e   _ T 8 _ , t y p e n a m e   T 9 , t y p e n a m e   T 1 0 , t y p e n a m e   _ T 1 0 _ >  
 c l a s s   M D L _ M o d i f y V a r i a b l e s :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   V a r i a b l e 1 ;  
 	 T 2   V a l u e 1 ;   v i r t u a l   _ T 2 _   _ V a l u e 1 _ ( ) { r e t u r n ( _ T 2 _ ) 0 ; }  
 	 T 3   V a r i a b l e 2 ;  
 	 T 4   V a l u e 2 ;   v i r t u a l   _ T 4 _   _ V a l u e 2 _ ( ) { r e t u r n ( _ T 4 _ ) 0 ; }  
 	 T 5   V a r i a b l e 3 ;  
 	 T 6   V a l u e 3 ;   v i r t u a l   _ T 6 _   _ V a l u e 3 _ ( ) { r e t u r n ( _ T 6 _ ) 0 ; }  
 	 T 7   V a r i a b l e 4 ;  
 	 T 8   V a l u e 4 ;   v i r t u a l   _ T 8 _   _ V a l u e 4 _ ( ) { r e t u r n ( _ T 8 _ ) 0 ; }  
 	 T 9   V a r i a b l e 5 ;  
 	 T 1 0   V a l u e 5 ;   v i r t u a l   _ T 1 0 _   _ V a l u e 5 _ ( ) { r e t u r n ( _ T 1 0 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ M o d i f y V a r i a b l e s ( )  
 	 {  
 	 	 V a r i a b l e 1   =   ( i n t ) 0 ;  
 	 	 V a r i a b l e 2   =   ( i n t ) 0 ;  
 	 	 V a r i a b l e 3   =   ( i n t ) 0 ;  
 	 	 V a r i a b l e 4   =   ( i n t ) 0 ;  
 	 	 V a r i a b l e 5   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 / /   n o t h i n g   h e r e ,   b e c a u s e   t h e   a c t u a l   c o d e   i s   g e n e r a t e d   i n   t h e   g e n e r a t o r  
 	 	 / /   _ V a l u e 1 _ ( )  
 	 	 / /   _ V a l u e 2 _ ( )  
 	 	 / /   _ V a l u e 3 _ ( )  
 	 	 / /   _ V a l u e 4 _ ( )  
 	 	 / /   _ V a l u e 5 _ ( )  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " B u y   n o w "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   T 7 , t y p e n a m e   T 8 , t y p e n a m e   T 9 , t y p e n a m e   _ T 9 _ , t y p e n a m e   T 1 0 , t y p e n a m e   T 1 1 , t y p e n a m e   T 1 2 , t y p e n a m e   T 1 3 , t y p e n a m e   T 1 4 , t y p e n a m e   T 1 5 , t y p e n a m e   T 1 6 , t y p e n a m e   T 1 7 , t y p e n a m e   T 1 8 , t y p e n a m e   T 1 9 , t y p e n a m e   T 2 0 , t y p e n a m e   T 2 1 , t y p e n a m e   T 2 2 , t y p e n a m e   T 2 3 , t y p e n a m e   T 2 4 , t y p e n a m e   T 2 5 , t y p e n a m e   T 2 6 , t y p e n a m e   T 2 7 , t y p e n a m e   T 2 8 , t y p e n a m e   T 2 9 , t y p e n a m e   T 3 0 , t y p e n a m e   T 3 1 , t y p e n a m e   T 3 2 , t y p e n a m e   T 3 3 , t y p e n a m e   T 3 4 , t y p e n a m e   T 3 5 , t y p e n a m e   T 3 6 , t y p e n a m e   T 3 7 , t y p e n a m e   _ T 3 7 _ , t y p e n a m e   T 3 8 , t y p e n a m e   _ T 3 8 _ , t y p e n a m e   T 3 9 , t y p e n a m e   _ T 3 9 _ , t y p e n a m e   T 4 0 , t y p e n a m e   T 4 1 , t y p e n a m e   T 4 2 , t y p e n a m e   T 4 3 , t y p e n a m e   T 4 4 , t y p e n a m e   _ T 4 4 _ , t y p e n a m e   T 4 5 , t y p e n a m e   _ T 4 5 _ , t y p e n a m e   T 4 6 , t y p e n a m e   _ T 4 6 _ , t y p e n a m e   T 4 7 , t y p e n a m e   T 4 8 , t y p e n a m e   T 4 9 , t y p e n a m e   T 5 0 , t y p e n a m e   T 5 1 , t y p e n a m e   _ T 5 1 _ , t y p e n a m e   T 5 2 , t y p e n a m e   T 5 3 , t y p e n a m e   T 5 4 >  
 c l a s s   M D L _ B u y N o w :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   G r o u p ;  
 	 T 2   S y m b o l ;  
 	 T 3   V o l u m e M o d e ;  
 	 T 4   V o l u m e S i z e ;  
 	 T 5   V o l u m e S i z e R i s k ;  
 	 T 6   V o l u m e R i s k ;  
 	 T 7   V o l u m e P e r c e n t ;  
 	 T 8   V o l u m e B l o c k P e r c e n t ;  
 	 T 9   d V o l u m e S i z e ;   v i r t u a l   _ T 9 _   _ d V o l u m e S i z e _ ( ) { r e t u r n ( _ T 9 _ ) 0 ; }  
 	 T 1 0   F i x e d R a t i o U n i t S i z e ;  
 	 T 1 1   F i x e d R a t i o D e l t a ;  
 	 T 1 2   m m T r a d e s P o o l ;  
 	 T 1 3   m m M g I n i t i a l L o t s ;  
 	 T 1 4   m m M g M u l t i p l y O n L o s s ;  
 	 T 1 5   m m M g M u l t i p l y O n P r o f i t ;  
 	 T 1 6   m m M g A d d L o t s O n L o s s ;  
 	 T 1 7   m m M g A d d L o t s O n P r o f i t ;  
 	 T 1 8   m m M g R e s e t O n L o s s ;  
 	 T 1 9   m m M g R e s e t O n P r o f i t ;  
 	 T 2 0   m m 1 3 2 6 I n i t i a l L o t s ;  
 	 T 2 1   m m 1 3 2 6 R e v e r s e ;  
 	 T 2 2   m m F i b o I n i t i a l L o t s ;  
 	 T 2 3   m m D a l e m b e r t I n i t i a l L o t s ;  
 	 T 2 4   m m D a l e m b e r t R e v e r s e ;  
 	 T 2 5   m m L a b o u c h e r e I n i t i a l L o t s ;  
 	 T 2 6   m m L a b o u c h e r e L i s t ;  
 	 T 2 7   m m L a b o u c h e r e R e v e r s e ;  
 	 T 2 8   m m S e q B a s e L o t s ;  
 	 T 2 9   m m S e q O n L o s s ;  
 	 T 3 0   m m S e q O n P r o f i t ;  
 	 T 3 1   m m S e q R e v e r s e ;  
 	 T 3 2   V o l u m e U p p e r L i m i t ;  
 	 T 3 3   S t o p L o s s M o d e ;  
 	 T 3 4   S t o p L o s s P i p s ;  
 	 T 3 5   S t o p L o s s P e r c e n t P r i c e ;  
 	 T 3 6   S t o p L o s s P e r c e n t T P ;  
 	 T 3 7   d l S t o p L o s s ;   v i r t u a l   _ T 3 7 _   _ d l S t o p L o s s _ ( ) { r e t u r n ( _ T 3 7 _ ) 0 ; }  
 	 T 3 8   d p S t o p L o s s ;   v i r t u a l   _ T 3 8 _   _ d p S t o p L o s s _ ( ) { r e t u r n ( _ T 3 8 _ ) 0 ; }  
 	 T 3 9   d d S t o p L o s s ;   v i r t u a l   _ T 3 9 _   _ d d S t o p L o s s _ ( ) { r e t u r n ( _ T 3 9 _ ) 0 ; }  
 	 T 4 0   T a k e P r o f i t M o d e ;  
 	 T 4 1   T a k e P r o f i t P i p s ;  
 	 T 4 2   T a k e P r o f i t P e r c e n t P r i c e ;  
 	 T 4 3   T a k e P r o f i t P e r c e n t S L ;  
 	 T 4 4   d l T a k e P r o f i t ;   v i r t u a l   _ T 4 4 _   _ d l T a k e P r o f i t _ ( ) { r e t u r n ( _ T 4 4 _ ) 0 ; }  
 	 T 4 5   d p T a k e P r o f i t ;   v i r t u a l   _ T 4 5 _   _ d p T a k e P r o f i t _ ( ) { r e t u r n ( _ T 4 5 _ ) 0 ; }  
 	 T 4 6   d d T a k e P r o f i t ;   v i r t u a l   _ T 4 6 _   _ d d T a k e P r o f i t _ ( ) { r e t u r n ( _ T 4 6 _ ) 0 ; }  
 	 T 4 7   E x p M o d e ;  
 	 T 4 8   E x p D a y s ;  
 	 T 4 9   E x p H o u r s ;  
 	 T 5 0   E x p M i n u t e s ;  
 	 T 5 1   d E x p ;   v i r t u a l   _ T 5 1 _   _ d E x p _ ( ) { r e t u r n ( _ T 5 1 _ ) 0 ; }  
 	 T 5 2   S l i p p a g e ;  
 	 T 5 3   M y C o m m e n t ;  
 	 T 5 4   A r r o w C o l o r B u y ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ B u y N o w ( )  
 	 {  
 	 	 G r o u p   =   ( s t r i n g ) " " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 V o l u m e M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 V o l u m e S i z e   =   ( d o u b l e ) 0 . 1 ;  
 	 	 V o l u m e S i z e R i s k   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 V o l u m e R i s k   =   ( d o u b l e ) 2 . 5 ;  
 	 	 V o l u m e P e r c e n t   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 V o l u m e B l o c k P e r c e n t   =   ( d o u b l e ) 3 . 0 ;  
 	 	 F i x e d R a t i o U n i t S i z e   =   ( d o u b l e ) 0 . 0 1 ;  
 	 	 F i x e d R a t i o D e l t a   =   ( d o u b l e ) 2 0 . 0 ;  
 	 	 m m T r a d e s P o o l   =   ( i n t ) 0 ;  
 	 	 m m M g I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m M g M u l t i p l y O n L o s s   =   ( d o u b l e ) 2 . 0 ;  
 	 	 m m M g M u l t i p l y O n P r o f i t   =   ( d o u b l e ) 1 . 0 ;  
 	 	 m m M g A d d L o t s O n L o s s   =   ( d o u b l e ) 0 . 0 ;  
 	 	 m m M g A d d L o t s O n P r o f i t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 m m M g R e s e t O n L o s s   =   ( i n t ) 0 ;  
 	 	 m m M g R e s e t O n P r o f i t   =   ( i n t ) 1 ;  
 	 	 m m 1 3 2 6 I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m 1 3 2 6 R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 m m F i b o I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m D a l e m b e r t I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m D a l e m b e r t R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 m m L a b o u c h e r e I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m L a b o u c h e r e L i s t   =   ( s t r i n g ) " 1 , 2 , 3 , 4 , 5 , 6 " ;  
 	 	 m m L a b o u c h e r e R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 m m S e q B a s e L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m S e q O n L o s s   =   ( s t r i n g ) " 3 , 2 , 6 " ;  
 	 	 m m S e q O n P r o f i t   =   ( s t r i n g ) " 1 " ;  
 	 	 m m S e q R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 V o l u m e U p p e r L i m i t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 S t o p L o s s M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 S t o p L o s s P i p s   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 S t o p L o s s P e r c e n t P r i c e   =   ( d o u b l e ) 0 . 5 5 ;  
 	 	 S t o p L o s s P e r c e n t T P   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 T a k e P r o f i t M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 T a k e P r o f i t P i p s   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 T a k e P r o f i t P e r c e n t P r i c e   =   ( d o u b l e ) 0 . 5 5 ;  
 	 	 T a k e P r o f i t P e r c e n t S L   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 E x p M o d e   =   ( s t r i n g ) " G T C " ;  
 	 	 E x p D a y s   =   ( i n t ) 0 ;  
 	 	 E x p H o u r s   =   ( i n t ) 1 ;  
 	 	 E x p M i n u t e s   =   ( i n t ) 0 ;  
 	 	 S l i p p a g e   =   ( u l o n g ) 4 ;  
 	 	 M y C o m m e n t   =   ( s t r i n g ) " " ;  
 	 	 A r r o w C o l o r B u y   =   ( c o l o r ) c l r B l u e ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / - -   s t o p s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 d o u b l e   s l l   =   0 ,   s l p   =   0 ,   t p l   =   0 ,   t p p   =   0 ;  
 	 	  
 	 	           i f   ( S t o p L o s s M o d e   = =   " f i x e d " )                   { s l p   =   S t o p L o s s P i p s ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " d y n a m i c P i p s " )       { s l p   =   _ d p S t o p L o s s _ ( ) ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " d y n a m i c D i g i t s " )   { s l p   =   t o P i p s ( _ d d S t o p L o s s _ ( ) , S y m b o l ) ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " d y n a m i c L e v e l " )     { s l l   =   _ d l S t o p L o s s _ ( ) ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " p e r c e n t P r i c e " )     { s l l   =   S y m b o l A s k ( S y m b o l )   -   ( S y m b o l A s k ( S y m b o l )   *   S t o p L o s s P e r c e n t P r i c e   /   1 0 0 ) ; }  
 	 	  
 	 	           i f   ( T a k e P r o f i t M o d e   = =   " f i x e d " )                   { t p p   =   T a k e P r o f i t P i p s ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " d y n a m i c P i p s " )       { t p p   =   _ d p T a k e P r o f i t _ ( ) ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " d y n a m i c D i g i t s " )   { t p p   =   t o P i p s ( _ d d T a k e P r o f i t _ ( ) , S y m b o l ) ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " d y n a m i c L e v e l " )     { t p l   =   _ d l T a k e P r o f i t _ ( ) ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " p e r c e n t P r i c e " )     { t p l   =   S y m b o l A s k ( S y m b o l )   +   ( S y m b o l A s k ( S y m b o l )   *   T a k e P r o f i t P e r c e n t P r i c e   /   1 0 0 ) ; }  
 	 	  
 	 	 i f   ( S t o p L o s s M o d e   = =   " p e r c e n t T P " )   {  
 	 	       i f   ( t p p   >   0 )   { s l p   =   t p p * S t o p L o s s P e r c e n t T P / 1 0 0 ; }  
 	 	       i f   ( t p l   >   0 )   { s l p   =   t o P i p s ( M a t h A b s ( S y m b o l A s k ( S y m b o l )   -   t p l ) ,   S y m b o l ) * S t o p L o s s P e r c e n t T P / 1 0 0 ; }  
 	 	 }  
 	 	 i f   ( T a k e P r o f i t M o d e   = =   " p e r c e n t S L " )   {  
 	 	       i f   ( s l p   >   0 )   { t p p   =   s l p * T a k e P r o f i t P e r c e n t S L / 1 0 0 ; }  
 	 	       i f   ( s l l   >   0 )   { t p p   =   t o P i p s ( M a t h A b s ( S y m b o l A s k ( S y m b o l )   -   s l l ) ,   S y m b o l ) * T a k e P r o f i t P e r c e n t S L / 1 0 0 ; }  
 	 	 }  
 	 	  
 	 	 / / - -   l o t s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 d o u b l e   l o t s   =   0 ;  
 	 	 d o u b l e   p r e _ s l l   =   s l l ;  
 	 	  
 	 	 i f   ( p r e _ s l l   = =   0 )   {  
 	 	 	 p r e _ s l l   =   S y m b o l A s k ( S y m b o l ) ;  
 	 	 }  
 	 	  
 	 	 d o u b l e   p r e _ s l _ p i p s   =   t o P i p s ( S y m b o l A s k ( S y m b o l ) - ( p r e _ s l l - t o D i g i t s ( s l p , S y m b o l ) ) ,   S y m b o l ) ;  
 	 	  
 	 	           i f   ( V o l u m e M o d e   = =   " f i x e d " )                         { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e S i z e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b l o c k - e q u i t y " )           { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e B l o c k P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b l o c k - b a l a n c e " )         { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e B l o c k P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b l o c k - f r e e m a r g i n " )   { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e B l o c k P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " e q u i t y " )                       { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b a l a n c e " )                     { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f r e e m a r g i n " )               { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " e q u i t y R i s k " )               { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b a l a n c e R i s k " )             { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f r e e m a r g i n R i s k " )       { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f i x e d R i s k " )                 { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e S i z e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f i x e d R a t i o " )               { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   F i x e d R a t i o U n i t S i z e ,   F i x e d R a t i o D e l t a ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " d y n a m i c " )                     { l o t s   =   _ d V o l u m e S i z e _ ( ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " 1 3 2 6 " )                           { l o t s   =   B e t 1 3 2 6 ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m 1 3 2 6 I n i t i a l L o t s ,   m m 1 3 2 6 R e v e r s e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f i b o n a c c i " )                 { l o t s   =   B e t F i b o n a c c i ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m F i b o I n i t i a l L o t s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " d a l e m b e r t " )                 { l o t s   =   B e t D a l e m b e r t ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m D a l e m b e r t I n i t i a l L o t s ,   m m D a l e m b e r t R e v e r s e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " l a b o u c h e r e " )               { l o t s   =   B e t L a b o u c h e r e ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m L a b o u c h e r e I n i t i a l L o t s ,   m m L a b o u c h e r e L i s t ,   m m L a b o u c h e r e R e v e r s e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " m a r t i n g a l e " )               { l o t s   =   B e t M a r t i n g a l e ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m M g I n i t i a l L o t s ,   m m M g M u l t i p l y O n L o s s ,   m m M g M u l t i p l y O n P r o f i t ,   m m M g A d d L o t s O n L o s s ,   m m M g A d d L o t s O n P r o f i t ,   m m M g R e s e t O n L o s s ,   m m M g R e s e t O n P r o f i t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " s e q u e n c e " )                   { l o t s   =   B e t S e q u e n c e ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m S e q B a s e L o t s ,   m m S e q O n L o s s ,   m m S e q O n P r o f i t ,   m m S e q R e v e r s e ) ; }  
 	 	  
 	 	 l o t s   =   A l i g n L o t s ( S y m b o l ,   l o t s ,   0 ,   V o l u m e U p p e r L i m i t ) ;  
 	 	  
 	 	 d a t e t i m e   e x p   =   E x p i r a t i o n T i m e ( E x p M o d e , E x p D a y s , E x p H o u r s , E x p M i n u t e s , _ d E x p _ ( ) ) ;  
 	 	  
 	 	 / / - -   s e n d   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 l o n g   t i c k e t   =   B u y N o w ( S y m b o l ,   l o t s ,   s l l ,   t p l ,   s l p ,   t p p ,   S l i p p a g e ,   ( M a g i c S t a r t + ( i n t ) G r o u p ) ,   M y C o m m e n t ,   A r r o w C o l o r B u y ,   e x p ) ;  
 	 	  
 	 	 i f   ( t i c k e t   >   0 )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " S e l l   n o w "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   T 7 , t y p e n a m e   T 8 , t y p e n a m e   T 9 , t y p e n a m e   _ T 9 _ , t y p e n a m e   T 1 0 , t y p e n a m e   T 1 1 , t y p e n a m e   T 1 2 , t y p e n a m e   T 1 3 , t y p e n a m e   T 1 4 , t y p e n a m e   T 1 5 , t y p e n a m e   T 1 6 , t y p e n a m e   T 1 7 , t y p e n a m e   T 1 8 , t y p e n a m e   T 1 9 , t y p e n a m e   T 2 0 , t y p e n a m e   T 2 1 , t y p e n a m e   T 2 2 , t y p e n a m e   T 2 3 , t y p e n a m e   T 2 4 , t y p e n a m e   T 2 5 , t y p e n a m e   T 2 6 , t y p e n a m e   T 2 7 , t y p e n a m e   T 2 8 , t y p e n a m e   T 2 9 , t y p e n a m e   T 3 0 , t y p e n a m e   T 3 1 , t y p e n a m e   T 3 2 , t y p e n a m e   T 3 3 , t y p e n a m e   T 3 4 , t y p e n a m e   T 3 5 , t y p e n a m e   T 3 6 , t y p e n a m e   T 3 7 , t y p e n a m e   _ T 3 7 _ , t y p e n a m e   T 3 8 , t y p e n a m e   _ T 3 8 _ , t y p e n a m e   T 3 9 , t y p e n a m e   _ T 3 9 _ , t y p e n a m e   T 4 0 , t y p e n a m e   T 4 1 , t y p e n a m e   T 4 2 , t y p e n a m e   T 4 3 , t y p e n a m e   T 4 4 , t y p e n a m e   _ T 4 4 _ , t y p e n a m e   T 4 5 , t y p e n a m e   _ T 4 5 _ , t y p e n a m e   T 4 6 , t y p e n a m e   _ T 4 6 _ , t y p e n a m e   T 4 7 , t y p e n a m e   T 4 8 , t y p e n a m e   T 4 9 , t y p e n a m e   T 5 0 , t y p e n a m e   T 5 1 , t y p e n a m e   _ T 5 1 _ , t y p e n a m e   T 5 2 , t y p e n a m e   T 5 3 , t y p e n a m e   T 5 4 >  
 c l a s s   M D L _ S e l l N o w :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   G r o u p ;  
 	 T 2   S y m b o l ;  
 	 T 3   V o l u m e M o d e ;  
 	 T 4   V o l u m e S i z e ;  
 	 T 5   V o l u m e S i z e R i s k ;  
 	 T 6   V o l u m e R i s k ;  
 	 T 7   V o l u m e P e r c e n t ;  
 	 T 8   V o l u m e B l o c k P e r c e n t ;  
 	 T 9   d V o l u m e S i z e ;   v i r t u a l   _ T 9 _   _ d V o l u m e S i z e _ ( ) { r e t u r n ( _ T 9 _ ) 0 ; }  
 	 T 1 0   F i x e d R a t i o U n i t S i z e ;  
 	 T 1 1   F i x e d R a t i o D e l t a ;  
 	 T 1 2   m m T r a d e s P o o l ;  
 	 T 1 3   m m M g I n i t i a l L o t s ;  
 	 T 1 4   m m M g M u l t i p l y O n L o s s ;  
 	 T 1 5   m m M g M u l t i p l y O n P r o f i t ;  
 	 T 1 6   m m M g A d d L o t s O n L o s s ;  
 	 T 1 7   m m M g A d d L o t s O n P r o f i t ;  
 	 T 1 8   m m M g R e s e t O n L o s s ;  
 	 T 1 9   m m M g R e s e t O n P r o f i t ;  
 	 T 2 0   m m 1 3 2 6 I n i t i a l L o t s ;  
 	 T 2 1   m m 1 3 2 6 R e v e r s e ;  
 	 T 2 2   m m F i b o I n i t i a l L o t s ;  
 	 T 2 3   m m D a l e m b e r t I n i t i a l L o t s ;  
 	 T 2 4   m m D a l e m b e r t R e v e r s e ;  
 	 T 2 5   m m L a b o u c h e r e I n i t i a l L o t s ;  
 	 T 2 6   m m L a b o u c h e r e L i s t ;  
 	 T 2 7   m m L a b o u c h e r e R e v e r s e ;  
 	 T 2 8   m m S e q B a s e L o t s ;  
 	 T 2 9   m m S e q O n L o s s ;  
 	 T 3 0   m m S e q O n P r o f i t ;  
 	 T 3 1   m m S e q R e v e r s e ;  
 	 T 3 2   V o l u m e U p p e r L i m i t ;  
 	 T 3 3   S t o p L o s s M o d e ;  
 	 T 3 4   S t o p L o s s P i p s ;  
 	 T 3 5   S t o p L o s s P e r c e n t P r i c e ;  
 	 T 3 6   S t o p L o s s P e r c e n t T P ;  
 	 T 3 7   d l S t o p L o s s ;   v i r t u a l   _ T 3 7 _   _ d l S t o p L o s s _ ( ) { r e t u r n ( _ T 3 7 _ ) 0 ; }  
 	 T 3 8   d p S t o p L o s s ;   v i r t u a l   _ T 3 8 _   _ d p S t o p L o s s _ ( ) { r e t u r n ( _ T 3 8 _ ) 0 ; }  
 	 T 3 9   d d S t o p L o s s ;   v i r t u a l   _ T 3 9 _   _ d d S t o p L o s s _ ( ) { r e t u r n ( _ T 3 9 _ ) 0 ; }  
 	 T 4 0   T a k e P r o f i t M o d e ;  
 	 T 4 1   T a k e P r o f i t P i p s ;  
 	 T 4 2   T a k e P r o f i t P e r c e n t P r i c e ;  
 	 T 4 3   T a k e P r o f i t P e r c e n t S L ;  
 	 T 4 4   d l T a k e P r o f i t ;   v i r t u a l   _ T 4 4 _   _ d l T a k e P r o f i t _ ( ) { r e t u r n ( _ T 4 4 _ ) 0 ; }  
 	 T 4 5   d p T a k e P r o f i t ;   v i r t u a l   _ T 4 5 _   _ d p T a k e P r o f i t _ ( ) { r e t u r n ( _ T 4 5 _ ) 0 ; }  
 	 T 4 6   d d T a k e P r o f i t ;   v i r t u a l   _ T 4 6 _   _ d d T a k e P r o f i t _ ( ) { r e t u r n ( _ T 4 6 _ ) 0 ; }  
 	 T 4 7   E x p M o d e ;  
 	 T 4 8   E x p D a y s ;  
 	 T 4 9   E x p H o u r s ;  
 	 T 5 0   E x p M i n u t e s ;  
 	 T 5 1   d E x p ;   v i r t u a l   _ T 5 1 _   _ d E x p _ ( ) { r e t u r n ( _ T 5 1 _ ) 0 ; }  
 	 T 5 2   S l i p p a g e ;  
 	 T 5 3   M y C o m m e n t ;  
 	 T 5 4   A r r o w C o l o r S e l l ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ S e l l N o w ( )  
 	 {  
 	 	 G r o u p   =   ( s t r i n g ) " " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 V o l u m e M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 V o l u m e S i z e   =   ( d o u b l e ) 0 . 1 ;  
 	 	 V o l u m e S i z e R i s k   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 V o l u m e R i s k   =   ( d o u b l e ) 2 . 5 ;  
 	 	 V o l u m e P e r c e n t   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 V o l u m e B l o c k P e r c e n t   =   ( d o u b l e ) 3 . 0 ;  
 	 	 F i x e d R a t i o U n i t S i z e   =   ( d o u b l e ) 0 . 0 1 ;  
 	 	 F i x e d R a t i o D e l t a   =   ( d o u b l e ) 2 0 . 0 ;  
 	 	 m m T r a d e s P o o l   =   ( i n t ) 0 ;  
 	 	 m m M g I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m M g M u l t i p l y O n L o s s   =   ( d o u b l e ) 2 . 0 ;  
 	 	 m m M g M u l t i p l y O n P r o f i t   =   ( d o u b l e ) 1 . 0 ;  
 	 	 m m M g A d d L o t s O n L o s s   =   ( d o u b l e ) 0 . 0 ;  
 	 	 m m M g A d d L o t s O n P r o f i t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 m m M g R e s e t O n L o s s   =   ( i n t ) 0 ;  
 	 	 m m M g R e s e t O n P r o f i t   =   ( i n t ) 1 ;  
 	 	 m m 1 3 2 6 I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m 1 3 2 6 R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 m m F i b o I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m D a l e m b e r t I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m D a l e m b e r t R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 m m L a b o u c h e r e I n i t i a l L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m L a b o u c h e r e L i s t   =   ( s t r i n g ) " 1 , 2 , 3 , 4 , 5 , 6 " ;  
 	 	 m m L a b o u c h e r e R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 m m S e q B a s e L o t s   =   ( d o u b l e ) 0 . 1 ;  
 	 	 m m S e q O n L o s s   =   ( s t r i n g ) " 3 , 2 , 6 " ;  
 	 	 m m S e q O n P r o f i t   =   ( s t r i n g ) " 1 " ;  
 	 	 m m S e q R e v e r s e   =   ( b o o l ) f a l s e ;  
 	 	 V o l u m e U p p e r L i m i t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 S t o p L o s s M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 S t o p L o s s P i p s   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 S t o p L o s s P e r c e n t P r i c e   =   ( d o u b l e ) 0 . 5 5 ;  
 	 	 S t o p L o s s P e r c e n t T P   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 T a k e P r o f i t M o d e   =   ( s t r i n g ) " f i x e d " ;  
 	 	 T a k e P r o f i t P i p s   =   ( d o u b l e ) 5 0 . 0 ;  
 	 	 T a k e P r o f i t P e r c e n t P r i c e   =   ( d o u b l e ) 0 . 5 5 ;  
 	 	 T a k e P r o f i t P e r c e n t S L   =   ( d o u b l e ) 1 0 0 . 0 ;  
 	 	 E x p M o d e   =   ( s t r i n g ) " G T C " ;  
 	 	 E x p D a y s   =   ( i n t ) 0 ;  
 	 	 E x p H o u r s   =   ( i n t ) 1 ;  
 	 	 E x p M i n u t e s   =   ( i n t ) 0 ;  
 	 	 S l i p p a g e   =   ( u l o n g ) 4 ;  
 	 	 M y C o m m e n t   =   ( s t r i n g ) " " ;  
 	 	 A r r o w C o l o r S e l l   =   ( c o l o r ) c l r R e d ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / - -   s t o p s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 d o u b l e   s l l   =   0 ,   s l p   =   0 ,   t p l   =   0 ,   t p p   =   0 ;  
 	 	  
 	 	           i f   ( S t o p L o s s M o d e   = =   " f i x e d " )                   { s l p   =   S t o p L o s s P i p s ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " d y n a m i c P i p s " )       { s l p   =   _ d p S t o p L o s s _ ( ) ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " d y n a m i c D i g i t s " )   { s l p   =   t o P i p s ( _ d d S t o p L o s s _ ( ) , S y m b o l ) ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " d y n a m i c L e v e l " )     { s l l   =   _ d l S t o p L o s s _ ( ) ; }  
 	 	 e l s e   i f   ( S t o p L o s s M o d e   = =   " p e r c e n t P r i c e " )     { s l l   =   S y m b o l B i d ( S y m b o l )   +   ( S y m b o l B i d ( S y m b o l )   *   S t o p L o s s P e r c e n t P r i c e   /   1 0 0 ) ; }  
 	 	  
 	 	           i f   ( T a k e P r o f i t M o d e   = =   " f i x e d " )                   { t p p   =   T a k e P r o f i t P i p s ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " d y n a m i c P i p s " )       { t p p   =   _ d p T a k e P r o f i t _ ( ) ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " d y n a m i c D i g i t s " )   { t p p   =   t o P i p s ( _ d d T a k e P r o f i t _ ( ) , S y m b o l ) ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " d y n a m i c L e v e l " )     { t p l   =   _ d l T a k e P r o f i t _ ( ) ; }  
 	 	 e l s e   i f   ( T a k e P r o f i t M o d e   = =   " p e r c e n t P r i c e " )     { t p l   =   S y m b o l B i d ( S y m b o l )   -   ( S y m b o l B i d ( S y m b o l )   *   T a k e P r o f i t P e r c e n t P r i c e   /   1 0 0 ) ; }  
 	 	  
 	 	 i f   ( S t o p L o s s M o d e   = =   " p e r c e n t T P " )   {  
 	 	       i f   ( t p p   >   0 )   { s l p   =   t p p * S t o p L o s s P e r c e n t T P / 1 0 0 ; }  
 	 	       i f   ( t p l   >   0 )   { s l p   =   t o P i p s ( M a t h A b s ( S y m b o l B i d ( S y m b o l )   -   t p l ) ,   S y m b o l ) * S t o p L o s s P e r c e n t T P / 1 0 0 ; }  
 	 	 }  
 	 	 i f   ( T a k e P r o f i t M o d e   = =   " p e r c e n t S L " )   {  
 	 	       i f   ( s l p   >   0 )   { t p p   =   s l p * T a k e P r o f i t P e r c e n t S L / 1 0 0 ; }  
 	 	       i f   ( s l l   >   0 )   { t p p   =   t o P i p s ( M a t h A b s ( S y m b o l B i d ( S y m b o l )   -   s l l ) ,   S y m b o l ) * T a k e P r o f i t P e r c e n t S L / 1 0 0 ; }  
 	 	 }  
 	 	  
 	 	 / / - -   l o t s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 d o u b l e   l o t s   =   0 ;  
 	 	 d o u b l e   p r e _ s l l   =   s l l ;  
 	 	  
 	 	 i f   ( p r e _ s l l   = =   0 )   {  
 	 	 	 p r e _ s l l   =   S y m b o l B i d ( S y m b o l ) ;  
 	 	 }  
 	 	  
 	 	 d o u b l e   p r e _ s l _ p i p s   =   t o P i p s ( ( p r e _ s l l + t o D i g i t s ( s l p , S y m b o l ) ) - S y m b o l B i d ( S y m b o l ) ,   S y m b o l ) ;  
 	 	  
 	 	           i f   ( V o l u m e M o d e   = =   " f i x e d " )                         { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e S i z e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b l o c k - e q u i t y " )           { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e B l o c k P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b l o c k - b a l a n c e " )         { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e B l o c k P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b l o c k - f r e e m a r g i n " )   { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e B l o c k P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " e q u i t y " )                       { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b a l a n c e " )                     { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f r e e m a r g i n " )               { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e P e r c e n t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " e q u i t y R i s k " )               { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " b a l a n c e R i s k " )             { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f r e e m a r g i n R i s k " )       { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f i x e d R i s k " )                 { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   V o l u m e S i z e R i s k ,   p r e _ s l _ p i p s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f i x e d R a t i o " )               { l o t s   =   D y n a m i c L o t s ( S y m b o l ,   V o l u m e M o d e ,   F i x e d R a t i o U n i t S i z e ,   F i x e d R a t i o D e l t a ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " d y n a m i c " )                     { l o t s   =   _ d V o l u m e S i z e _ ( ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " 1 3 2 6 " )                           { l o t s   =   B e t 1 3 2 6 ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m 1 3 2 6 I n i t i a l L o t s ,   m m 1 3 2 6 R e v e r s e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " f i b o n a c c i " )                 { l o t s   =   B e t F i b o n a c c i ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m F i b o I n i t i a l L o t s ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " d a l e m b e r t " )                 { l o t s   =   B e t D a l e m b e r t ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m D a l e m b e r t I n i t i a l L o t s ,   m m D a l e m b e r t R e v e r s e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " l a b o u c h e r e " )               { l o t s   =   B e t L a b o u c h e r e ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m L a b o u c h e r e I n i t i a l L o t s ,   m m L a b o u c h e r e L i s t ,   m m L a b o u c h e r e R e v e r s e ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " m a r t i n g a l e " )               { l o t s   =   B e t M a r t i n g a l e ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m M g I n i t i a l L o t s ,   m m M g M u l t i p l y O n L o s s ,   m m M g M u l t i p l y O n P r o f i t ,   m m M g A d d L o t s O n L o s s ,   m m M g A d d L o t s O n P r o f i t ,   m m M g R e s e t O n L o s s ,   m m M g R e s e t O n P r o f i t ) ; }  
 	 	 e l s e   i f   ( V o l u m e M o d e   = =   " s e q u e n c e " )                   { l o t s   =   B e t S e q u e n c e ( G r o u p ,   S y m b o l ,   m m T r a d e s P o o l ,   m m S e q B a s e L o t s ,   m m S e q O n L o s s ,   m m S e q O n P r o f i t ,   m m S e q R e v e r s e ) ; }  
 	 	  
 	 	 l o t s   =   A l i g n L o t s ( S y m b o l ,   l o t s ,   0 ,   V o l u m e U p p e r L i m i t ) ;  
 	 	  
 	 	 d a t e t i m e   e x p   =   E x p i r a t i o n T i m e ( E x p M o d e , E x p D a y s , E x p H o u r s , E x p M i n u t e s , _ d E x p _ ( ) ) ;  
 	 	  
 	 	 / / - -   s e n d   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 l o n g   t i c k e t   =   S e l l N o w ( S y m b o l ,   l o t s ,   s l l ,   t p l ,   s l p ,   t p p ,   S l i p p a g e ,   ( M a g i c S t a r t + ( i n t ) G r o u p ) ,   M y C o m m e n t ,   A r r o w C o l o r S e l l ,   e x p ) ;  
 	 	  
 	 	 i f   ( t i c k e t   >   0 )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " N o   t r a d e "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 >  
 c l a s s   M D L _ N o O p e n e d O r d e r s :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   G r o u p M o d e ;  
 	 T 2   G r o u p ;  
 	 T 3   S y m b o l M o d e ;  
 	 T 4   S y m b o l ;  
 	 T 5   B u y s O r S e l l s ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ N o O p e n e d O r d e r s ( )  
 	 {  
 	 	 G r o u p M o d e   =   ( s t r i n g ) " g r o u p " ;  
 	 	 G r o u p   =   ( s t r i n g ) " " ;  
 	 	 S y m b o l M o d e   =   ( s t r i n g ) " s y m b o l " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 B u y s O r S e l l s   =   ( s t r i n g ) " b o t h " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 b o o l   e x i s t   =   f a l s e ;  
 	 	  
 	 	 f o r   ( i n t   i n d e x   =   T r a d e s T o t a l ( ) - 1 ;   i n d e x   > =   0 ;   i n d e x - - )  
 	 	 {  
 	 	 	 i f   ( T r a d e S e l e c t B y I n d e x ( i n d e x ,   G r o u p M o d e ,   G r o u p ,   S y m b o l M o d e ,   S y m b o l ,   B u y s O r S e l l s ) )  
 	 	 	 {  
 	 	 	 	 e x i s t   =   t r u e ;  
 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 i f   ( e x i s t   = =   f a l s e )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " I f   t r a d e "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 >  
 c l a s s   M D L _ I f O p e n e d O r d e r s :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   G r o u p M o d e ;  
 	 T 2   G r o u p ;  
 	 T 3   S y m b o l M o d e ;  
 	 T 4   S y m b o l ;  
 	 T 5   B u y s O r S e l l s ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ I f O p e n e d O r d e r s ( )  
 	 {  
 	 	 G r o u p M o d e   =   ( s t r i n g ) " g r o u p " ;  
 	 	 G r o u p   =   ( s t r i n g ) " " ;  
 	 	 S y m b o l M o d e   =   ( s t r i n g ) " s y m b o l " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 B u y s O r S e l l s   =   ( s t r i n g ) " b o t h " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 b o o l   e x i s t   =   f a l s e ;  
 	 	  
 	 	 f o r   ( i n t   i n d e x   =   T r a d e s T o t a l ( ) - 1 ;   i n d e x   > =   0 ;   i n d e x - - )  
 	 	 {  
 	 	 	 i f   ( T r a d e S e l e c t B y I n d e x ( i n d e x ,   G r o u p M o d e ,   G r o u p ,   S y m b o l M o d e ,   S y m b o l ,   B u y s O r S e l l s ) )  
 	 	 	 {  
 	 	 	 	 e x i s t   =   t r u e ;  
 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 i f   ( e x i s t   = =   t r u e )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " C l o s e   t r a d e s "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   T 7 , t y p e n a m e   T 8 >  
 c l a s s   M D L _ C l o s e O p e n e d :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   G r o u p M o d e ;  
 	 T 2   G r o u p ;  
 	 T 3   S y m b o l M o d e ;  
 	 T 4   S y m b o l ;  
 	 T 5   B u y s O r S e l l s ;  
 	 T 6   O r d e r M i n u t e s ;  
 	 T 7   S l i p p a g e ;  
 	 T 8   A r r o w C o l o r ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ C l o s e O p e n e d ( )  
 	 {  
 	 	 G r o u p M o d e   =   ( s t r i n g ) " g r o u p " ;  
 	 	 G r o u p   =   ( s t r i n g ) " " ;  
 	 	 S y m b o l M o d e   =   ( s t r i n g ) " s y m b o l " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 B u y s O r S e l l s   =   ( s t r i n g ) " b o t h " ;  
 	 	 O r d e r M i n u t e s   =   ( i n t ) 0 ;  
 	 	 S l i p p a g e   =   ( u l o n g ) 4 ;  
 	 	 A r r o w C o l o r   =   ( c o l o r ) c l r D e e p P i n k ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 i n t   c l o s e d _ c o u n t   =   0 ;  
 	 	 b o o l   f i n i s h e d         =   f a l s e ;  
 	 	  
 	 	 w h i l e   ( f i n i s h e d   = =   f a l s e )  
 	 	 {  
 	 	 	 i n t   c o u n t   =   0 ;  
 	 	  
 	 	 	 f o r   ( i n t   i n d e x   =   T r a d e s T o t a l ( ) - 1 ;   i n d e x   > =   0 ;   i n d e x - - )  
 	 	 	 {  
 	 	 	 	 i f   ( T r a d e S e l e c t B y I n d e x ( i n d e x ,   G r o u p M o d e ,   G r o u p ,   S y m b o l M o d e ,   S y m b o l ,   B u y s O r S e l l s ) )  
 	 	 	 	 {  
 	 	 	 	 	 d a t e t i m e   t i m e _ d i f f   =   T i m e C u r r e n t ( )   -   O r d e r O p e n T i m e ( ) ;  
 	 	  
 	 	 	 	 	 i f   ( t i m e _ d i f f   <   0 )   { t i m e _ d i f f   =   0 ; }   / /   t h i s   a c t u a l l y   h a p p e n s   s o m e t i m e s  
 	 	  
 	 	 	 	 	 i f   ( t i m e _ d i f f   > =   6 0   *   O r d e r M i n u t e s )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 i f   ( C l o s e T r a d e ( O r d e r T i c k e t ( ) ,   S l i p p a g e ,   A r r o w C o l o r ) )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 c l o s e d _ c o u n t + + ;  
 	 	 	 	 	 	 }  
 	 	  
 	 	 	 	 	 	 c o u n t + + ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( c o u n t   = =   0 )   { f i n i s h e d   =   t r u e ; }  
 	 	 }  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " C o n d i t i o n "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ , t y p e n a m e   T 4 >  
 c l a s s   M D L _ C o n d i t i o n :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 T 4   c r o s s w i d t h ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ C o n d i t i o n ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " > " ;  
 	 	 c r o s s w i d t h   =   ( i n t ) 1 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 b o o l   o u t p u t 1   =   f a l s e ,   o u t p u t 2   =   f a l s e ;   / /   o u t p u t   1   a n d   o u t p u t   2  
 	 	 i n t   c r o s s o v e r   =   0 ;  
 	 	  
 	 	 i f   ( c o m p a r e   = =   " x > "   | |   c o m p a r e   = =   " x < " )   { c r o s s o v e r   =   1 ; }  
 	 	  
 	 	 f o r   ( i n t   i   =   0 ;   i   < =   c r o s s o v e r ;   i + + )  
 	 	 {  
 	 	 	 / /   i = 0   -   n o r m a l   p a s s ,   i = 1   -   c r o s s o v e r   p a s s  
 	 	  
 	 	 	 / /   L e f t   o p e r a n d   o f   t h e   c o n d i t i o n  
 	 	 	 F X D _ M O R E _ S H I F T   =   i   *   c r o s s w i d t h ;  
 	 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 	 i f   ( M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 	 / /   R i g h t   o p e r a n d   o f   t h e   c o n d i t i o n  
 	 	 	 F X D _ M O R E _ S H I F T   =   i   *   c r o s s w i d t h ;  
 	 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 	 i f   ( M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 	 / /   C o n d i t i o n s  
 	 	 	 i f   ( C o m p a r e V a l u e s ( c o m p a r e ,   l o ,   r o ) )  
 	 	 	 {  
 	 	 	 	 i f   ( i   = =   0 )  
 	 	 	 	 {  
 	 	 	 	 	 o u t p u t 1   =   t r u e ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 i f   ( i   = =   0 )  
 	 	 	 	 {  
 	 	 	 	 	 o u t p u t 2   =   t r u e ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 o u t p u t 2   =   f a l s e ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( c r o s s o v e r   = =   1 )  
 	 	 	 {  
 	 	 	 	 i f   ( C o m p a r e V a l u e s ( c o m p a r e ,   r o ,   l o ) )  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( i   = =   0 )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 o u t p u t 2   =   t r u e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( i   = =   1 )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 o u t p u t 1   =   f a l s e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 F X D _ M O R E _ S H I F T   =   0 ;   / /   r e s e t  
 	 	  
 	 	 	     i f   ( o u t p u t 1   = =   t r u e )   { _ c a l l b a c k _ ( 1 ) ; }  
 	 	 e l s e   i f   ( o u t p u t 2   = =   t r u e )   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " I n d i c a t o r   i s   i n v i s i b l e "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 >  
 c l a s s   M D L _ I n d i c a t o r I s I n v i s i b l e :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   I n d i c a t o r ;   v i r t u a l   _ T 1 _   _ I n d i c a t o r _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   A d d i t i o n a l C a n d l e s ;  
 	 T 3   E x c e p t i o n C a n d l e s ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 i n t   i t f ;  
 	 s t r i n g   i s y m b o l ;  
 	 d a t e t i m e   b a r t i m e ;  
 	 b o o l   l a s t p a s s ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ I n d i c a t o r I s I n v i s i b l e ( )  
 	 {  
 	 	 A d d i t i o n a l C a n d l e s   =   ( i n t ) 0 ;  
 	 	 E x c e p t i o n C a n d l e s   =   ( i n t ) 0 ;  
 	 	 / *   S t a t i c   P a r a m e t e r s   ( i n i t i a l   v a l u e )   * /  
 	 	 i t f   =     0 ;  
 	 	 i s y m b o l   =     " " ;  
 	 	 b a r t i m e   =     0 ;  
 	 	 l a s t p a s s   =     f a l s e ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 b o o l   n e x t             =   t r u e ;  
 	 	 i n t   e x c e p t i o n s   =   0 ;  
 	 	  
 	 	 f o r   ( i n t   i = 0 ;   i   < =   A d d i t i o n a l C a n d l e s ;   i + + )  
 	 	 {  
 	 	 	 F X D _ M O R E _ S H I F T   =   i ;  
 	 	 	 _ T 1 _   i v a l u e = _ I n d i c a t o r _ ( ) ;  
 	 	 	 F X D _ M O R E _ S H I F T   =   0 ;   / /   r e s e t  
 	 	 	  
 	 	 	 i f   ( i v a l u e   ! =   0   & &   i v a l u e   ! =   E M P T Y _ V A L U E   & &   i v a l u e   ! =   - E M P T Y _ V A L U E )  
 	 	 	 {  
 	 	 	 	 i f   ( A d d i t i o n a l C a n d l e s   >   0   & &   E x c e p t i o n C a n d l e s   >   0 )  
 	 	 	 	 {  
 	 	 	 	 	 e x c e p t i o n s + + ;  
 	 	  
 	 	 	 	 	 i f   ( e x c e p t i o n s   < =   E x c e p t i o n C a n d l e s )   { c o n t i n u e ; }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 n e x t   =   f a l s e ;  
 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 l a s t p a s s   =   n e x t ;  
 	 	  
 	 	 i f   ( n e x t   = =   t r u e )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " I n d i c a t o r   i s   v i s i b l e "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 >  
 c l a s s   M D L _ I n d i c a t o r I s V i s i b l e :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   I n d i c a t o r ;   v i r t u a l   _ T 1 _   _ I n d i c a t o r _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   A d d i t i o n a l C a n d l e s ;  
 	 T 3   E x c e p t i o n C a n d l e s ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 i n t   i t f ;  
 	 s t r i n g   i s y m b o l ;  
 	 d a t e t i m e   b a r t i m e ;  
 	 b o o l   l a s t p a s s ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ I n d i c a t o r I s V i s i b l e ( )  
 	 {  
 	 	 A d d i t i o n a l C a n d l e s   =   ( i n t ) 0 ;  
 	 	 E x c e p t i o n C a n d l e s   =   ( i n t ) 0 ;  
 	 	 / *   S t a t i c   P a r a m e t e r s   ( i n i t i a l   v a l u e )   * /  
 	 	 i t f   =     0 ;  
 	 	 i s y m b o l   =     " " ;  
 	 	 b a r t i m e   =     0 ;  
 	 	 l a s t p a s s   =     f a l s e ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 b o o l   n e x t             =   t r u e ;  
 	 	 i n t   e x c e p t i o n s   =   0 ;  
 	 	  
 	 	 f o r   ( i n t   i = 0 ;   i   < =   A d d i t i o n a l C a n d l e s ;   i + + )  
 	 	 {  
 	 	 	 F X D _ M O R E _ S H I F T   =   i ;  
 	 	 	 _ T 1 _   i v a l u e = _ I n d i c a t o r _ ( ) ;  
 	 	 	 F X D _ M O R E _ S H I F T   =   0 ;   / /   r e s e t  
 	 	 	  
 	 	 	 i f   ( i v a l u e   = =   0   | |   i v a l u e   = =   E M P T Y _ V A L U E   | |   i v a l u e   = =   - E M P T Y _ V A L U E )  
 	 	 	 {  
 	 	 	 	 i f   ( A d d i t i o n a l C a n d l e s   >   0   & &   E x c e p t i o n C a n d l e s   >   0 )  
 	 	 	 	 {  
 	 	 	 	 	 e x c e p t i o n s + + ;  
 	 	  
 	 	 	 	 	 i f   ( e x c e p t i o n s   < =   E x c e p t i o n C a n d l e s )   { c o n t i n u e ; }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 n e x t   =   f a l s e ;  
 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 l a s t p a s s   =   n e x t ;  
 	 	  
 	 	 i f   ( n e x t   = =   t r u e )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " I n d i c a t o r   r i s e "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   T 7 >  
 c l a s s   M D L _ I n d i c a t o r R i s e :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   I n d i c a t o r ;   v i r t u a l   _ T 1 _   _ I n d i c a t o r _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   R i s e M o d e ;  
 	 T 3   R i s e C a n d l e s ;  
 	 T 4   E x c e p t i o n C a n d l e s ;  
 	 T 5   R i s e P i p s ;  
 	 T 6   R i s e V a l u e ;  
 	 T 7   P a s s T y p e ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 d a t e t i m e   b a r t i m e ;  
 	 i n t   f l i p s t a t e ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ I n d i c a t o r R i s e ( )  
 	 {  
 	 	 R i s e M o d e   =   ( s t r i n g ) " p i p s " ;  
 	 	 R i s e C a n d l e s   =   ( i n t ) 4 ;  
 	 	 E x c e p t i o n C a n d l e s   =   ( i n t ) 0 ;  
 	 	 R i s e P i p s   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 R i s e V a l u e   =   ( d o u b l e ) 5 . 0 ;  
 	 	 P a s s T y p e   =   ( s t r i n g ) " c o n t " ;  
 	 	 / *   S t a t i c   P a r a m e t e r s   ( i n i t i a l   v a l u e )   * /  
 	 	 f l i p s t a t e   =     0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 i n t   e x c e p t i o n s               =   0 ;  
 	 	 b o o l   n e x t                         =   t r u e ;  
 	 	 d o u b l e   i n i t i a l _ l e v e l   =   - E M P T Y _ V A L U E ;  
 	 	 d o u b l e   l e v e l                   =   i n i t i a l _ l e v e l ;  
 	 	 s t r i n g   s y m b o l                 =   S y m b o l ( ) ;  
 	 	  
 	 	 i f   ( R i s e C a n d l e s   < =   0 )   { R i s e C a n d l e s   =   1 ; }  
 	 	  
 	 	 f o r   ( i n t   i   =   R i s e C a n d l e s ;   i   > =   0 ;   i - - )  
 	 	 {  
 	 	 	 F X D _ M O R E _ S H I F T   =   i ;  
 	 	 	 _ T 1 _   i v a l u e   =   _ I n d i c a t o r _ ( ) ;  
 	 	 	 s y m b o l   =   I n d i c a t o r . S y m b o l ;  
 	 	 	 F X D _ M O R E _ S H I F T   =   0 ;   / /   r e s e t  
 	 	 	  
 	 	 	 i f   ( i   = =   R i s e C a n d l e s )  
 	 	 	 {  
 	 	 	 	 i n i t i a l _ l e v e l   =   i v a l u e ;  
 	 	 	 	 l e v e l                   =   i n i t i a l _ l e v e l ;  
 	 	 	 	 c o n t i n u e ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( i v a l u e   < =   l e v e l )  
 	 	 	 {  
 	 	 	 	 i f   ( R i s e C a n d l e s   >   1   & &   E x c e p t i o n C a n d l e s   >   0 )  
 	 	 	 	 {  
 	 	 	 	 	 e x c e p t i o n s + + ;  
 	 	  
 	 	 	 	 	 i f   ( e x c e p t i o n s   < =   E x c e p t i o n C a n d l e s )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 l e v e l   =   i v a l u e ;  
 	 	 	 	 	 	 c o n t i n u e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 n e x t   =   f a l s e ;  
 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	  
 	 	 	 l e v e l   =   i v a l u e ;  
 	 	 }  
 	 	  
 	 	 i f   (  
 	 	 	       n e x t   = =   f a l s e  
 	 	 	 | |   ( R i s e M o d e   = =   " p i p s "   & &   t o P i p s ( l e v e l - i n i t i a l _ l e v e l ,   s y m b o l )   <   R i s e P i p s )  
 	 	 	 | |   ( R i s e M o d e   = =   " v a l u e "   & &   ( l e v e l - i n i t i a l _ l e v e l )   <   R i s e V a l u e )  
 	 	 	 )  
 	 	 {  
 	 	 	 n e x t             =   f a l s e ;  
 	 	 	 f l i p s t a t e   =   0 ;  
 	 	 }  
 	 	  
 	 	 i f   ( P a s s T y p e   = =   " c o n t "   | |   ( P a s s T y p e   = =   " o n c e "   & &   f l i p s t a t e   = =   0 )   | |   ( P a s s T y p e   = =   " b a r "   & &   b a r t i m e   <   i T i m e ( S y m b o l ( ) , P e r i o d ( ) , 1 ) ) )  
 	 	 {  
 	 	 	 i f   ( P a s s T y p e   = =   " b a r " )  
 	 	 	 {  
 	 	 	 	 b a r t i m e   =   i T i m e ( S y m b o l ( ) , P e r i o d ( ) , 1 ) ;  
 	 	 	 }  
 	 	 	 e l s e   i f   ( P a s s T y p e   = =   " o n c e "   & &   n e x t   = =   t r u e )  
 	 	 	 {  
 	 	 	 	 f l i p s t a t e   =   1 ;  
 	 	 	 }  
 	 	 	  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 n e x t   =   f a l s e ;  
 	 	 }  
 	 	  
 	 	 i f   ( n e x t   = =   t r u e )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " I n d i c a t o r   f a l l "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   T 6 , t y p e n a m e   T 7 >  
 c l a s s   M D L _ I n d i c a t o r F a l l :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   I n d i c a t o r ;   v i r t u a l   _ T 1 _   _ I n d i c a t o r _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   F a l l M o d e ;  
 	 T 3   F a l l C a n d l e s ;  
 	 T 4   E x c e p t i o n C a n d l e s ;  
 	 T 5   F a l l P i p s ;  
 	 T 6   F a l l V a l u e ;  
 	 T 7   P a s s T y p e ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 d a t e t i m e   b a r t i m e ;  
 	 i n t   f l i p s t a t e ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ I n d i c a t o r F a l l ( )  
 	 {  
 	 	 F a l l M o d e   =   ( s t r i n g ) " p i p s " ;  
 	 	 F a l l C a n d l e s   =   ( i n t ) 4 ;  
 	 	 E x c e p t i o n C a n d l e s   =   ( i n t ) 0 ;  
 	 	 F a l l P i p s   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 F a l l V a l u e   =   ( d o u b l e ) 5 . 0 ;  
 	 	 P a s s T y p e   =   ( s t r i n g ) " c o n t " ;  
 	 	 / *   S t a t i c   P a r a m e t e r s   ( i n i t i a l   v a l u e )   * /  
 	 	 f l i p s t a t e   =     0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 i n t   e x c e p t i o n s               =   0 ;  
 	 	 b o o l   n e x t                         =   t r u e ;  
 	 	 d o u b l e   i n i t i a l _ l e v e l   =   E M P T Y _ V A L U E ;  
 	 	 d o u b l e   l e v e l                   =   i n i t i a l _ l e v e l ;  
 	 	 s t r i n g   s y m b o l                 =   S y m b o l ( ) ;  
 	 	  
 	 	 i f   ( F a l l C a n d l e s   < =   0 )   { F a l l C a n d l e s   =   1 ; }  
 	 	  
 	 	 f o r   ( i n t   i   =   F a l l C a n d l e s ;   i   > =   0 ;   i - - )  
 	 	 {  
 	 	 	 F X D _ M O R E _ S H I F T   =   i ;  
 	 	 	 _ T 1 _   i v a l u e   =   _ I n d i c a t o r _ ( ) ;  
 	 	 	 s y m b o l   =   I n d i c a t o r . S y m b o l ;  
 	 	 	 F X D _ M O R E _ S H I F T   =   0 ;   / /   r e s e t  
 	 	 	  
 	 	 	 i f   ( i   = =   F a l l C a n d l e s )  
 	 	 	 {  
 	 	 	 	 i n i t i a l _ l e v e l   =   i v a l u e ;  
 	 	 	 	 l e v e l                   =   i n i t i a l _ l e v e l ;  
 	 	 	 	 c o n t i n u e ;  
 	 	 	 }  
 	 	 	  
 	 	 	 i f   ( i v a l u e   > =   l e v e l )  
 	 	 	 {  
 	 	 	 	 i f   ( F a l l C a n d l e s   >   1   & &   E x c e p t i o n C a n d l e s   >   0 )  
 	 	 	 	 {  
 	 	 	 	 	 e x c e p t i o n s + + ;  
 	 	  
 	 	 	 	 	 i f   ( e x c e p t i o n s   < =   E x c e p t i o n C a n d l e s )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 l e v e l   =   i v a l u e ;  
 	 	 	 	 	 	 c o n t i n u e ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 n e x t   =   f a l s e ;  
 	 	 	 	 b r e a k ;  
 	 	 	 }  
 	 	  
 	 	 	 l e v e l   =   i v a l u e ;  
 	 	 }  
 	 	  
 	 	 i f   (  
 	 	 	       n e x t   = =   f a l s e  
 	 	 	 | |   ( F a l l M o d e   = =   " p i p s "   & &   t o P i p s ( i n i t i a l _ l e v e l - l e v e l ,   s y m b o l )   <   F a l l P i p s )  
 	 	 	 | |   ( F a l l M o d e   = =   " v a l u e "   & &   ( i n i t i a l _ l e v e l - l e v e l )   <   F a l l V a l u e )  
 	 	 	 )  
 	 	 {  
 	 	 	 n e x t             =   f a l s e ;  
 	 	 	 f l i p s t a t e   =   0 ;  
 	 	 }  
 	 	  
 	 	 i f   ( P a s s T y p e   = =   " c o n t "   | |   ( P a s s T y p e   = =   " o n c e "   & &   f l i p s t a t e   = =   0 )   | |   ( P a s s T y p e   = =   " b a r "   & &   b a r t i m e   <   i T i m e ( S y m b o l ( ) , P e r i o d ( ) , 1 ) ) )  
 	 	 {  
 	 	 	 i f   ( P a s s T y p e   = =   " b a r " )  
 	 	 	 {  
 	 	 	 	 b a r t i m e   =   i T i m e ( S y m b o l ( ) , P e r i o d ( ) , 1 ) ;  
 	 	 	 }  
 	 	 	 e l s e   i f   ( P a s s T y p e   = =   " o n c e "   & &   n e x t   = =   t r u e )  
 	 	 	 {  
 	 	 	 	 f l i p s t a t e   =   1 ;  
 	 	 	 }  
 	 	  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 n e x t   =   f a l s e ;  
 	 	 }  
 	 	  
 	 	 i f   ( n e x t   = =   t r u e )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 1 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 1 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : A T R _ T O P   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 2 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 2 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : A T R _ B O T T O M   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " D r a w   L i n e "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   _ T 5 _ , t y p e n a m e   T 6 , t y p e n a m e   _ T 6 _ , t y p e n a m e   T 7 , t y p e n a m e   _ T 7 _ , t y p e n a m e   T 8 , t y p e n a m e   _ T 8 _ , t y p e n a m e   T 9 , t y p e n a m e   T 1 0 , t y p e n a m e   T 1 1 , t y p e n a m e   T 1 2 , t y p e n a m e   T 1 3 , t y p e n a m e   T 1 4 , t y p e n a m e   T 1 5 , t y p e n a m e   T 1 6 , t y p e n a m e   T 1 7 , t y p e n a m e   T 1 8 , t y p e n a m e   T 1 9 , t y p e n a m e   T 2 0 , t y p e n a m e   T 2 1 >  
 c l a s s   M D L _ C h a r t D r a w L i n e :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   O b j e c t P e r B a r ;  
 	 T 2   O b j e c t U p d a t e ;  
 	 T 3   O b j N a m e ;  
 	 T 4   O b j e c t T y p e ;  
 	 T 5   O b j T i m e 1 ;   v i r t u a l   _ T 5 _   _ O b j T i m e 1 _ ( ) { r e t u r n ( _ T 5 _ ) 0 ; }  
 	 T 6   O b j P r i c e 1 ;   v i r t u a l   _ T 6 _   _ O b j P r i c e 1 _ ( ) { r e t u r n ( _ T 6 _ ) 0 ; }  
 	 T 7   O b j T i m e 2 ;   v i r t u a l   _ T 7 _   _ O b j T i m e 2 _ ( ) { r e t u r n ( _ T 7 _ ) 0 ; }  
 	 T 8   O b j P r i c e 2 ;   v i r t u a l   _ T 8 _   _ O b j P r i c e 2 _ ( ) { r e t u r n ( _ T 8 _ ) 0 ; }  
 	 T 9   O b j A n g l e ;  
 	 T 1 0   O b j R a y ;  
 	 T 1 1   O b j R a y L e f t ;  
 	 T 1 2   O b j R a y R i g h t ;  
 	 T 1 3   O b j C o l o r ;  
 	 T 1 4   O b j S t y l e ;  
 	 T 1 5   O b j W i d t h ;  
 	 T 1 6   O b j B a c k ;  
 	 T 1 7   O b j S e l e c t a b l e ;  
 	 T 1 8   O b j S e l e c t e d ;  
 	 T 1 9   O b j H i d d e n ;  
 	 T 2 0   O b j Z o r d e r ;  
 	 T 2 1   O b j C h a r t S u b W i n d o w ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 i n t   c o u n t ;  
 	 d a t e t i m e   t i m e 0 ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ C h a r t D r a w L i n e ( )  
 	 {  
 	 	 O b j e c t P e r B a r   =   ( b o o l ) t r u e ;  
 	 	 O b j e c t U p d a t e   =   ( b o o l ) t r u e ;  
 	 	 O b j N a m e   =   ( s t r i n g ) " " ;  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ V L I N E ;  
 	 	 O b j A n g l e   =   ( d o u b l e ) 4 5 . 0 ;  
 	 	 O b j R a y   =   ( b o o l ) t r u e ;  
 	 	 O b j R a y L e f t   =   ( b o o l ) f a l s e ;  
 	 	 O b j R a y R i g h t   =   ( b o o l ) f a l s e ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r D e e p P i n k ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 	 O b j W i d t h   =   ( i n t ) 1 ;  
 	 	 O b j B a c k   =   ( b o o l ) f a l s e ;  
 	 	 O b j S e l e c t a b l e   =   ( b o o l ) t r u e ;  
 	 	 O b j S e l e c t e d   =   ( b o o l ) f a l s e ;  
 	 	 O b j H i d d e n   =   ( b o o l ) f a l s e ;  
 	 	 O b j Z o r d e r   =   ( i n t ) 0 ;  
 	 	 O b j C h a r t S u b W i n d o w   =   ( s t r i n g ) " " ;  
 	 	 / *   S t a t i c   P a r a m e t e r s   ( i n i t i a l   v a l u e )   * /  
 	 	 c o u n t   =     0 ;  
 	 	 t i m e 0   =     0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 s t r i n g   O b j N a m e P r e f i x   =   " f x d _ l i n e _ " ;  
 	 	 l o n g   O b j C h a r t I D             =   0 ;  
 	 	 i n t   s u b w i n d o w _ i d           =   W i n d o w F i n d V i s i b l e ( O b j C h a r t I D ,   O b j C h a r t S u b W i n d o w ) ;  
 	 	  
 	 	 i f   ( s u b w i n d o w _ i d   > =   0 )  
 	 	 {  
 	 	 	 s t r i n g   n a m e               =   " " ;  
 	 	 	 s t r i n g   n a m e _ b a s e     =   " " ;  
 	 	 	 b o o l   g e t _ n e w _ n a m e   =   f a l s e ;  
 	 	 	 b o o l   d o _ u p d a t e         =   t r u e ;  
 	 	  
 	 	 	 i f   ( O b j e c t P e r B a r   = =   t r u e )  
 	 	 	 {  
 	 	 	 	 d a t e t i m e   t i m e   =   i T i m e ( S y m b o l ( ) , 0 , 1 ) ;  
 	 	  
 	 	 	 	 i f   ( t i m e 0   <   t i m e )  
 	 	 	 	 {  
 	 	 	 	 	 t i m e 0                 =   t i m e ;  
 	 	 	 	 	 g e t _ n e w _ n a m e   =   t r u e ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( O b j e c t U p d a t e   = =   f a l s e )   { d o _ u p d a t e   =   f a l s e ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 i f   ( O b j e c t U p d a t e   = =   f a l s e )   { g e t _ n e w _ n a m e   =   t r u e ; }  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( d o _ u p d a t e )  
 	 	 	 {  
 	 	 	 	 i f   ( O b j N a m e   ! =   " " )   { n a m e _ b a s e   =   O b j N a m e ; }   e l s e   { n a m e _ b a s e   =   O b j N a m e P r e f i x   +   _ _ b l o c k _ u s e r _ n u m b e r   +   " _ " ; }  
 	 	  
 	 	 	 	 i f   ( g e t _ n e w _ n a m e   = =   f a l s e )  
 	 	 	 	 {  
 	 	 	 	 	 n a m e   =   n a m e _ b a s e   +   I n t e g e r T o S t r i n g ( c o u n t ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 w h i l e   ( t r u e )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 c o u n t + + ;  
 	 	 	 	 	 	 n a m e   =   n a m e _ b a s e   +   I n t e g e r T o S t r i n g ( c o u n t ) ;  
 	 	  
 	 	 	 	 	 	 i f   ( O b j e c t F i n d ( O b j C h a r t I D , n a m e )   <   0 )   { b r e a k ; }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 i f   ( O b j N a m e   ! =   " "   & &   c o u n t   = =   0 )   { n a m e   =   O b j N a m e ; }  
 	 	  
 	 	 	 	 i f   ( O b j e c t F i n d ( O b j C h a r t I D , n a m e )   <   0   & &   ! O b j e c t C r e a t e ( O b j C h a r t I D , n a m e , ( E N U M _ O B J E C T ) O b j e c t T y p e , s u b w i n d o w _ i d , 0 , 0 ) )  
 	 	 	 	 {  
 	 	 	 	 	 P r i n t ( _ _ F U N C T I O N _ _ , " :   f a i l e d   t o   c r e a t e   l i n e   o b j e c t !   E r r o r   c o d e   =   " , G e t L a s t E r r o r ( ) ) ;  
 	 	 	 	 }  
 	 	  
 	 	 	 	 d o u b l e   p 1 = 0 ,   p 2 = 0 ;  
 	 	 	 	 d a t e t i m e   t 1 = 0 ,   t 2 = 0 ;  
 	 	  
 	 	 	 	 s w i t c h ( O b j e c t T y p e )  
 	 	 	 	 {  
 	 	 	 	 	 c a s e   O B J _ V L I N E                 :   { t 1 = 1 ;   b r e a k ; }  
 	 	 	 	 	 c a s e   O B J _ H L I N E                 :   { p 1 = 1 ;   b r e a k ; }  
 	 	 	 	 	 c a s e   O B J _ T R E N D                 :   { t 1 = 1 ;   p 1 = 1 ;   t 2 = 1 ;   p 2 = 1 ;   b r e a k ; }  
 	 	 	 	 	 c a s e   O B J _ T R E N D B Y A N G L E   :   { t 1 = 1 ;   p 1 = 1 ;   b r e a k ; }  
 	 	 	 	 	 c a s e   O B J _ C Y C L E S               :   { t 1 = 1 ;   p 1 = 1 ;   t 2 = 1 ;   p 2 = 1 ;   b r e a k ; }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 i f   ( t 1   = =   1 )   { t 1   =   _ O b j T i m e 1 _ ( ) ;   O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ T I M E , 0 , t 1 ) ; }  
 	 	 	 	 i f   ( t 2   = =   1 )   { t 2   =   _ O b j T i m e 2 _ ( ) ;   O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ T I M E , 1 , t 2 ) ; }  
 	 	 	 	 i f   ( p 1   = =   1 )   { p 1   =   _ O b j P r i c e 1 _ ( ) ;   O b j e c t S e t D o u b l e ( O b j C h a r t I D , n a m e , O B J P R O P _ P R I C E , 0 , p 1 ) ; }  
 	 	 	 	 i f   ( p 2   = =   1 )   { p 2   =   _ O b j P r i c e 2 _ ( ) ;   O b j e c t S e t D o u b l e ( O b j C h a r t I D , n a m e , O B J P R O P _ P R I C E , 1 , p 2 ) ; }  
 	 	  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ S T Y L E , O b j S t y l e ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ C O L O R , O b j C o l o r ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ B A C K , O b j B a c k ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ W I D T H , O b j W i d t h ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ S E L E C T A B L E , O b j S e l e c t a b l e ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ S E L E C T E D , O b j S e l e c t e d ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ H I D D E N , O b j H i d d e n ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ Z O R D E R , O b j Z o r d e r ) ;  
 	 	  
 	 	 	 	 O b j e c t S e t D o u b l e ( O b j C h a r t I D , n a m e , O B J P R O P _ A N G L E , O b j A n g l e ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ R A Y , O b j R a y ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ R A Y _ L E F T , O b j R a y L e f t ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ R A Y _ R I G H T , O b j R a y R i g h t ) ;  
 	 	  
 	 	 	 	 C h a r t R e d r a w ( ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " O n c e   p e r   t i c k "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 >  
 c l a s s   M D L _ O n c e P e r T i c k :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   S y m b o l ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 d a t e t i m e   t 0 ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ O n c e P e r T i c k ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 s t a t i c   d o u b l e   a 0 ,   b 0 ;  
 	 	  
 	 	  
 	 	 d o u b l e   a       =   S y m b o l I n f o D o u b l e ( S y m b o l , S Y M B O L _ A S K ) ;  
 	 	 d o u b l e   b       =   S y m b o l I n f o D o u b l e ( S y m b o l , S Y M B O L _ B I D ) ;  
 	 	 d a t e t i m e   t   =   ( d a t e t i m e ) S y m b o l I n f o I n t e g e r ( S y m b o l , S Y M B O L _ T I M E ) ;  
 	 	  
 	 	 i f   ( t   ! =   t 0   | |   a   ! =   a 0   | |   b   ! =   b 0 )  
 	 	 {  
 	 	 	 t 0   =   t ;  
 	 	 	 a 0   =   a ;  
 	 	 	 b 0   =   b ;  
 	 	  
 	 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 _ c a l l b a c k _ ( 0 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 3 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 3 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : A T R _ T P _ L I N E   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 4 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 4 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : A T R _ S L _ L I N E   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 5 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 5 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : T C H E C K _ L I N E   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 6 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 6 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : A T R _ S T P _ L I N E _ T O _ T P   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 7 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 7 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : A T R _ S S L _ L I N E _ T O _ S L   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " F o r m u l a "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   _ T 1 _ , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   _ T 3 _ >  
 c l a s s   M D L _ F o r m u l a _ 8 :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   L o ;   v i r t u a l   _ T 1 _   _ L o _ ( ) { r e t u r n ( _ T 1 _ ) 0 ; }  
 	 T 2   c o m p a r e ;  
 	 T 3   R o ;   v i r t u a l   _ T 3 _   _ R o _ ( ) { r e t u r n ( _ T 3 _ ) 0 ; }  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ F o r m u l a _ 8 ( )  
 	 {  
 	 	 c o m p a r e   =   ( s t r i n g ) " + " ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 _ T 1 _   l o   =   _ L o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 1 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( l o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 _ T 3 _   r o   =   _ R o _ ( ) ;  
 	 	 i f   ( t y p e n a m e ( _ T 3 _ )   ! =   " s t r i n g "   & &   M a t h A b s ( r o )   = =   E M P T Y _ V A L U E )   { r e t u r n ; }  
 	 	  
 	 	 v : : T C H E C K _ S _ L I N E _ T O _ T C   =   f o r m u l a ( c o m p a r e ,   l o ,   r o ) ;  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
 / /   " O n c e   p e r   b a r "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 >  
 c l a s s   M D L _ O n c e P e r B a r :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   S y m b o l ;  
 	 T 2   P e r i o d ;  
 	 T 3   P a s s M a x T i m e s ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 s t r i n g   t o k e n s [ ] ;  
 	 i n t   p a s s e s [ ] ;  
 	 d a t e t i m e   o l d _ v a l u e s [ ] ;  
 	 d a t e t i m e   t i m e [ ] ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ O n c e P e r B a r ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 P a s s M a x T i m e s   =   ( i n t ) 1 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 / /   t h i s   i s   s t a t i c   f o r   s p e e d   r e a s o n s  
 	 	  
 	 	 b o o l   n e x t         =   f a l s e ;  
 	 	 s t r i n g   t o k e n   =   S y m b o l   +   I n t e g e r T o S t r i n g ( P e r i o d ) ;  
 	 	 i n t   i n d e x         =   A r r a y S e a r c h ( t o k e n s ,   t o k e n ) ;  
 	 	  
 	 	 i f   ( i n d e x   = =   - 1 )  
 	 	 {  
 	 	 	 i n d e x   =   A r r a y S i z e ( t o k e n s ) ;  
 	 	 	  
 	 	 	 A r r a y R e s i z e ( t o k e n s ,   i n d e x   +   1 ) ;  
 	 	 	 A r r a y R e s i z e ( o l d _ v a l u e s ,   i n d e x   +   1 ) ;  
 	 	 	 A r r a y R e s i z e ( p a s s e s ,   i n d e x   +   1 ) ;  
 	 	 	  
 	 	 	 t o k e n s [ i n d e x ]   =   t o k e n ;  
 	 	 	 p a s s e s [ i n d e x ]   =   0 ;  
 	 	 	 o l d _ v a l u e s [ i n d e x ]   =   0 ;  
 	 	 }  
 	 	  
 	 	 i f   ( P a s s M a x T i m e s   >   0 )  
 	 	 {  
 	 	 	 C o p y T i m e ( S y m b o l ,   P e r i o d ,   1 ,   1 ,   t i m e ) ;  
 	 	 	 d a t e t i m e   n e w _ v a l u e   =   t i m e [ 0 ] ;  
 	 	  
 	 	 	 i f   ( n e w _ v a l u e   >   o l d _ v a l u e s [ i n d e x ] )  
 	 	 	 {  
 	 	 	 	 p a s s e s [ i n d e x ] + + ;  
 	 	  
 	 	 	 	 i f   ( p a s s e s [ i n d e x ]   > =   P a s s M a x T i m e s )  
 	 	 	 	 {  
 	 	 	 	 	 o l d _ v a l u e s [ i n d e x ]     =   n e w _ v a l u e ;  
 	 	 	 	 	 p a s s e s [ i n d e x ]   =   0 ;  
 	 	 	 	 }  
 	 	  
 	 	 	 	 n e x t   =   t r u e ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 i f   ( n e x t )   { _ c a l l b a c k _ ( 1 ) ; }   e l s e   { _ c a l l b a c k _ ( 0 ) ; }  
 	 }  
 } ;  
  
 / /   " D r a w   T e x t "   m o d e l  
 t e m p l a t e < t y p e n a m e   T 1 , t y p e n a m e   T 2 , t y p e n a m e   T 3 , t y p e n a m e   T 4 , t y p e n a m e   T 5 , t y p e n a m e   _ T 5 _ , t y p e n a m e   T 6 , t y p e n a m e   _ T 6 _ , t y p e n a m e   T 7 , t y p e n a m e   T 8 , t y p e n a m e   T 9 , t y p e n a m e   _ T 9 _ , t y p e n a m e   T 1 0 , t y p e n a m e   T 1 1 , t y p e n a m e   T 1 2 , t y p e n a m e   T 1 3 , t y p e n a m e   T 1 4 , t y p e n a m e   T 1 5 , t y p e n a m e   T 1 6 , t y p e n a m e   T 1 7 , t y p e n a m e   T 1 8 , t y p e n a m e   T 1 9 , t y p e n a m e   T 2 0 , t y p e n a m e   T 2 1 >  
 c l a s s   M D L _ C h a r t D r a w T e x t :   p u b l i c   B l o c k C a l l s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 T 1   O b j e c t P e r B a r ;  
 	 T 2   O b j e c t U p d a t e ;  
 	 T 3   O b j N a m e ;  
 	 T 4   O b j e c t T y p e ;  
 	 T 5   O b j T i m e 1 ;   v i r t u a l   _ T 5 _   _ O b j T i m e 1 _ ( ) { r e t u r n ( _ T 5 _ ) 0 ; }  
 	 T 6   O b j P r i c e 1 ;   v i r t u a l   _ T 6 _   _ O b j P r i c e 1 _ ( ) { r e t u r n ( _ T 6 _ ) 0 ; }  
 	 T 7   O b j X ;  
 	 T 8   O b j Y ;  
 	 T 9   O b j T e x t ;   v i r t u a l   _ T 9 _   _ O b j T e x t _ ( ) { r e t u r n ( _ T 9 _ ) 0 ; }  
 	 T 1 0   O b j F o n t ;  
 	 T 1 1   O b j F o n t S i z e ;  
 	 T 1 2   O b j A n g l e ;  
 	 T 1 3   O b j C o r n e r ;  
 	 T 1 4   O b j A n c h o r ;  
 	 T 1 5   O b j C o l o r ;  
 	 T 1 6   O b j B a c k ;  
 	 T 1 7   O b j S e l e c t a b l e ;  
 	 T 1 8   O b j S e l e c t e d ;  
 	 T 1 9   O b j H i d d e n ;  
 	 T 2 0   O b j Z o r d e r ;  
 	 T 2 1   O b j C h a r t S u b W i n d o w ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 i n t   c o u n t ;  
 	 d a t e t i m e   t i m e 0 ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L _ C h a r t D r a w T e x t ( )  
 	 {  
 	 	 O b j e c t P e r B a r   =   ( b o o l ) t r u e ;  
 	 	 O b j e c t U p d a t e   =   ( b o o l ) t r u e ;  
 	 	 O b j N a m e   =   ( s t r i n g ) " " ;  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ T E X T ;  
 	 	 O b j X   =   ( i n t ) 0 ;  
 	 	 O b j Y   =   ( i n t ) 0 ;  
 	 	 O b j F o n t   =   ( s t r i n g ) " A r i a l " ;  
 	 	 O b j F o n t S i z e   =   ( i n t ) 1 0 ;  
 	 	 O b j A n g l e   =   ( d o u b l e ) 0 . 0 ;  
 	 	 O b j C o r n e r   =   ( E N U M _ B A S E _ C O R N E R ) C O R N E R _ L E F T _ U P P E R ;  
 	 	 O b j A n c h o r   =   ( i n t ) A N C H O R _ L E F T _ U P P E R ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r S k y B l u e ;  
 	 	 O b j B a c k   =   ( b o o l ) f a l s e ;  
 	 	 O b j S e l e c t a b l e   =   ( b o o l ) t r u e ;  
 	 	 O b j S e l e c t e d   =   ( b o o l ) f a l s e ;  
 	 	 O b j H i d d e n   =   ( b o o l ) f a l s e ;  
 	 	 O b j Z o r d e r   =   ( i n t ) 0 ;  
 	 	 O b j C h a r t S u b W i n d o w   =   ( s t r i n g ) " " ;  
 	 	 / *   S t a t i c   P a r a m e t e r s   ( i n i t i a l   v a l u e )   * /  
 	 	 c o u n t   =     0 ;  
 	 	 t i m e 0   =     0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 v i r t u a l   v o i d   _ e x e c u t e _ ( )  
 	 {  
 	 	 s t r i n g   O b j N a m e P r e f i x   =   " f x d _ t e x t _ " ;  
 	 	 l o n g   O b j C h a r t I D             =   0 ;  
 	 	 i n t   s u b w i n d o w _ i d           =   W i n d o w F i n d V i s i b l e ( O b j C h a r t I D ,   O b j C h a r t S u b W i n d o w ) ;  
 	 	  
 	 	 i f   ( s u b w i n d o w _ i d   > =   0 )  
 	 	 {  
 	 	 	 s t r i n g   n a m e               =   " " ;  
 	 	 	 s t r i n g   n a m e _ b a s e     =   " " ;  
 	 	 	 b o o l   g e t _ n e w _ n a m e   =   f a l s e ;  
 	 	 	 b o o l   d o _ u p d a t e         =   t r u e ;  
 	 	  
 	 	 	 i f   ( O b j e c t P e r B a r   = =   t r u e )  
 	 	 	 {  
 	 	 	 	 d a t e t i m e   t i m e   =   i T i m e ( S y m b o l ( ) , 0 , 1 ) ;  
 	 	  
 	 	 	 	 i f   ( t i m e 0   <   t i m e )  
 	 	 	 	 {  
 	 	 	 	 	 t i m e 0                 =   t i m e ;  
 	 	 	 	 	 g e t _ n e w _ n a m e   =   t r u e ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( O b j e c t U p d a t e   = =   f a l s e )   { d o _ u p d a t e   =   f a l s e ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 i f   ( O b j e c t U p d a t e   = =   f a l s e )   { g e t _ n e w _ n a m e   =   t r u e ; }  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( d o _ u p d a t e )  
 	 	 	 {  
 	 	 	 	 i f   ( O b j N a m e   ! =   " " )   { n a m e _ b a s e   =   O b j N a m e ; }   e l s e   { n a m e _ b a s e   =   O b j N a m e P r e f i x   +   _ _ b l o c k _ u s e r _ n u m b e r   +   " _ " ; }  
 	 	  
 	 	 	 	 i f   ( g e t _ n e w _ n a m e   = =   f a l s e )  
 	 	 	 	 {  
 	 	 	 	 	 n a m e   =   n a m e _ b a s e   +   I n t e g e r T o S t r i n g ( c o u n t ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 w h i l e   ( t r u e )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 c o u n t + + ;  
 	 	 	 	 	 	 n a m e   =   n a m e _ b a s e   +   I n t e g e r T o S t r i n g ( c o u n t ) ;  
 	 	  
 	 	 	 	 	 	 i f   ( O b j e c t F i n d ( O b j C h a r t I D , n a m e )   <   0 )   { b r e a k ; }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	  
 	 	 	 	 i f   ( O b j N a m e   ! =   " "   & &   c o u n t   = =   0 )   { n a m e   =   O b j N a m e ; }  
 	 	  
 	 	 	 	 i f   ( O b j e c t F i n d ( O b j C h a r t I D , n a m e )   <   0   & &   ! O b j e c t C r e a t e ( O b j C h a r t I D , n a m e , ( E N U M _ O B J E C T ) O b j e c t T y p e , s u b w i n d o w _ i d , 0 , 0 ) )  
 	 	 	 	 {  
 	 	 	 	 	 P r i n t ( _ _ F U N C T I O N _ _ , " :   f a i l e d   t o   c r e a t e   t e x t   o b j e c t !   E r r o r   c o d e   =   " , G e t L a s t E r r o r ( ) ) ;  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 d o u b l e   p 1 = 0 ,   p 2 = 0 ;  
 	 	 	 	 d a t e t i m e   t 1 = 0 ,   t 2 = 0 ;  
 	 	  
 	 	 	 	 i f   ( O b j e c t T y p e   = =   O B J _ T E X T )  
 	 	 	 	 {  
 	 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ T I M E , 0 , ( l o n g ) _ O b j T i m e 1 _ ( ) ) ;  
 	 	 	 	 	 O b j e c t S e t D o u b l e ( O b j C h a r t I D , n a m e , O B J P R O P _ P R I C E , 0 , ( d o u b l e ) _ O b j P r i c e 1 _ ( ) ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ X D I S T A N C E , O b j X ) ;  
 	 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ Y D I S T A N C E , O b j Y ) ;  
 	 	 	 	 }  
 	 	  
 	 	 	 	 O b j e c t S e t S t r i n g ( O b j C h a r t I D , n a m e , O B J P R O P _ T E X T , ( s t r i n g ) ( _ O b j T e x t _ ( ) ) ) ;  
 	 	 	 	 O b j e c t S e t S t r i n g ( O b j C h a r t I D , n a m e , O B J P R O P _ F O N T , O b j F o n t ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ F O N T S I Z E , O b j F o n t S i z e ) ;  
 	 	 	 	 O b j e c t S e t D o u b l e ( O b j C h a r t I D , n a m e , O B J P R O P _ A N G L E , O b j A n g l e ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ C O R N E R , O b j C o r n e r ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ A N C H O R , O b j A n c h o r ) ;  
 	 	  
 	 	 	 	 / / O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ S T Y L E , O b j S t y l e ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ C O L O R , O b j C o l o r ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ B A C K , O b j B a c k ) ;  
 	 	 	 	 / / O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ W I D T H , O b j W i d t h ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ S E L E C T A B L E , O b j S e l e c t a b l e ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ S E L E C T E D , O b j S e l e c t e d ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ H I D D E N , O b j H i d d e n ) ;  
 	 	 	 	 O b j e c t S e t I n t e g e r ( O b j C h a r t I D , n a m e , O B J P R O P _ Z O R D E R , O b j Z o r d e r ) ;  
 	 	  
 	 	 	 	 C h a r t R e d r a w ( ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 _ c a l l b a c k _ ( 1 ) ;  
 	 }  
 } ;  
  
  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
  
 / /   " N u m e r i c "   m o d e l  
 c l a s s   M D L I C _ v a l u e _ v a l u e  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 d o u b l e   V a l u e ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ v a l u e _ v a l u e ( )  
 	 {  
 	 	 V a l u e   =   ( d o u b l e ) 1 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 r e t u r n   V a l u e ;  
 	 }  
 } ;  
  
 / /   " P i p s "   m o d e l  
 c l a s s   M D L I C _ v a l u e _ p o i n t s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 d o u b l e   V a l u e ;  
 	 i n t   M o d e V a l u e ;  
 	 s t r i n g   S y m b o l ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ v a l u e _ p o i n t s ( )  
 	 {  
 	 	 V a l u e   =   ( d o u b l e ) 1 0 . 0 ;  
 	 	 M o d e V a l u e   =   ( i n t ) 1 ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 d o u b l e   r e t v a l   =   0 ;  
 	 	  
 	 	           i f   ( M o d e V a l u e   = =   0 )   { r e t v a l   =   V a l u e ; }  
 	 	 e l s e   i f   ( M o d e V a l u e   = =   1 )   { r e t v a l   =   V a l u e * S y m b o l I n f o D o u b l e ( S y m b o l , S Y M B O L _ P O I N T ) * P i p V a l u e ( S y m b o l ) ; }  
 	 	  
 	 	 r e t u r n   r e t v a l ;  
 	 }  
 } ;  
  
 / /   " A v e r a g e   T r u e   R a n g e "   m o d e l  
 c l a s s   M D L I C _ i n d i c a t o r s _ i A T R  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 i n t   A T R p e r i o d ;  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ i n d i c a t o r s _ i A T R ( )  
 	 {  
 	 	 A T R p e r i o d   =   ( i n t ) 1 4 ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 r e t u r n   i A T R ( S y m b o l ,   P e r i o d ,   A T R p e r i o d ,   S h i f t   +   F X D _ M O R E _ S H I F T ) ;  
 	 }  
 } ;  
  
 / /   " T i m e "   m o d e l  
 c l a s s   M D L I C _ v a l u e _ t i m e  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 i n t   M o d e T i m e ;  
 	 i n t   T i m e S o u r c e ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   T i m e C a n d l e I D ;  
 	 s t r i n g   T i m e M a r k e t ;  
 	 E N U M _ T I M E F R A M E S   T i m e C a n d l e T i m e f r a m e ;  
 	 i n t   T i m e C o m p o n e n t Y e a r ;  
 	 i n t   T i m e C o m p o n e n t M o n t h ;  
 	 d o u b l e   T i m e C o m p o n e n t D a y ;  
 	 d o u b l e   T i m e C o m p o n e n t H o u r ;  
 	 d o u b l e   T i m e C o m p o n e n t M i n u t e ;  
 	 i n t   T i m e C o m p o n e n t S e c o n d ;  
 	 i n t   M o d e T i m e S h i f t ;  
 	 i n t   T i m e S h i f t Y e a r s ;  
 	 i n t   T i m e S h i f t M o n t h s ;  
 	 i n t   T i m e S h i f t W e e k s ;  
 	 d o u b l e   T i m e S h i f t D a y s ;  
 	 d o u b l e   T i m e S h i f t H o u r s ;  
 	 d o u b l e   T i m e S h i f t M i n u t e s ;  
 	 i n t   T i m e S h i f t S e c o n d s ;  
 	 b o o l   T i m e S k i p W e e k d a y s ;  
 	 / *   S t a t i c   P a r a m e t e r s   * /  
 	 d a t e t i m e   r e t v a l ;  
 	 d a t e t i m e   r e t v a l 0 ;  
 	 i n t   M o d e T i m e 0 ;  
 	 i n t   s m o d e s h i f t ;  
 	 i n t   y e a r s 0 ;  
 	 i n t   m o n t h s 0 ;  
 	 d a t e t i m e   T i m e [ ] ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ v a l u e _ t i m e ( )  
 	 {  
 	 	 M o d e T i m e   =   ( i n t ) 0 ;  
 	 	 T i m e S o u r c e   =   ( i n t ) 0 ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 T i m e C a n d l e I D   =   ( i n t ) 1 ;  
 	 	 T i m e M a r k e t   =   ( s t r i n g ) " " ;  
 	 	 T i m e C a n d l e T i m e f r a m e   =   ( E N U M _ T I M E F R A M E S ) 0 ;  
 	 	 T i m e C o m p o n e n t Y e a r   =   ( i n t ) 0 ;  
 	 	 T i m e C o m p o n e n t M o n t h   =   ( i n t ) 0 ;  
 	 	 T i m e C o m p o n e n t D a y   =   ( d o u b l e ) 0 . 0 ;  
 	 	 T i m e C o m p o n e n t H o u r   =   ( d o u b l e ) 1 2 . 0 ;  
 	 	 T i m e C o m p o n e n t M i n u t e   =   ( d o u b l e ) 0 . 0 ;  
 	 	 T i m e C o m p o n e n t S e c o n d   =   ( i n t ) 0 ;  
 	 	 M o d e T i m e S h i f t   =   ( i n t ) 0 ;  
 	 	 T i m e S h i f t Y e a r s   =   ( i n t ) 0 ;  
 	 	 T i m e S h i f t M o n t h s   =   ( i n t ) 0 ;  
 	 	 T i m e S h i f t W e e k s   =   ( i n t ) 0 ;  
 	 	 T i m e S h i f t D a y s   =   ( d o u b l e ) 0 . 0 ;  
 	 	 T i m e S h i f t H o u r s   =   ( d o u b l e ) 0 . 0 ;  
 	 	 T i m e S h i f t M i n u t e s   =   ( d o u b l e ) 0 . 0 ;  
 	 	 T i m e S h i f t S e c o n d s   =   ( i n t ) 0 ;  
 	 	 T i m e S k i p W e e k d a y s   =   ( b o o l ) f a l s e ;  
 	 	 / *   S t a t i c   P a r a m e t e r s   ( i n i t i a l   v a l u e )   * /  
 	 	 r e t v a l   =     0 ;  
 	 	 r e t v a l 0   =     0 ;  
 	 	 M o d e T i m e 0   =     0 ;  
 	 	 s m o d e s h i f t   =     0 ;  
 	 	 y e a r s 0   =     0 ;  
 	 	 m o n t h s 0   =     0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d a t e t i m e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / /   t h i s   i s   s t a t i c   f o r   s p e e d   r e a s o n s  
 	 	  
 	 	 i f   ( T i m e M a r k e t   = =   " " )   T i m e M a r k e t   =   S y m b o l ( ) ;  
 	 	  
 	 	 i f   ( M o d e T i m e   = =   0 )  
 	 	 {  
 	 	 	           i f   ( T i m e S o u r c e   = =   0 )   { r e t v a l   =   T i m e C u r r e n t ( ) ; }  
 	 	 	 e l s e   i f   ( T i m e S o u r c e   = =   1 )   { r e t v a l   =   T i m e L o c a l ( ) ; }  
 	 	 	 e l s e   i f   ( T i m e S o u r c e   = =   2 )   { r e t v a l   =   T i m e G M T ( ) ; }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e T i m e   = =   1 )  
 	 	 {  
 	 	 	 r e t v a l     =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 r e t v a l 0   =   r e t v a l ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e T i m e = = 2 )  
 	 	 {  
 	 	 	 r e t v a l   =   T i m e F r o m C o m p o n e n t s ( T i m e S o u r c e ,   T i m e C o m p o n e n t Y e a r ,   T i m e C o m p o n e n t M o n t h ,   T i m e C o m p o n e n t D a y ,   T i m e C o m p o n e n t H o u r ,   T i m e C o m p o n e n t M i n u t e ,   T i m e C o m p o n e n t S e c o n d ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e T i m e   = =   3 )  
 	 	 {  
 	 	 	 A r r a y S e t A s S e r i e s ( T i m e , t r u e ) ;  
 	 	 	 C o p y T i m e ( T i m e M a r k e t , T i m e C a n d l e T i m e f r a m e , T i m e C a n d l e I D , 1 , T i m e ) ;  
 	 	 	 r e t v a l   =   T i m e [ 0 ] ;  
 	 	 }  
 	 	  
 	 	 i f   ( M o d e T i m e S h i f t   >   0 )  
 	 	 {  
 	 	 	 i n t   s h   =   1 ;  
 	 	  
 	 	 	 i f   ( M o d e T i m e S h i f t   = =   1 )   { s h   =   - 1 ; }  
 	 	  
 	 	 	 i f   (  
 	 	 	 	       M o d e T i m e S h i f t   ! =   s m o d e s h i f t  
 	 	 	 	 | |   T i m e S h i f t Y e a r s   ! =   y e a r s 0  
 	 	 	 	 | |   T i m e S h i f t M o n t h s   ! =   m o n t h s 0  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 y e a r s 0     =   T i m e S h i f t Y e a r s ;  
 	 	 	 	 m o n t h s 0   =   T i m e S h i f t M o n t h s ;  
 	 	  
 	 	 	 	 i f   ( T i m e S h i f t Y e a r s   >   0   | |   T i m e S h i f t M o n t h s   >   0 )  
 	 	 	 	 {  
 	 	 	 	 	 i n t   y e a r   =   0 ,   m o n t h   =   0 ,   w e e k   =   0 ,   d a y   =   0 ,   h o u r   =   0 ,   m i n u t e   =   0 ,   s e c o n d   =   0 ;  
 	 	  
 	 	 	 	 	 i f   ( M o d e T i m e   = =   3 )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 y e a r       =   T i m e C o m p o n e n t Y e a r ;  
 	 	 	 	 	 	 m o n t h     =   T i m e C o m p o n e n t Y e a r ;  
 	 	 	 	 	 	 d a y         =   ( i n t ) M a t h F l o o r ( T i m e C o m p o n e n t D a y ) ;  
 	 	 	 	 	 	 h o u r       =   ( i n t ) ( M a t h F l o o r ( T i m e C o m p o n e n t H o u r )   +   ( 2 4   *   ( T i m e C o m p o n e n t D a y   -   M a t h F l o o r ( T i m e C o m p o n e n t D a y ) ) ) ) ;  
 	 	 	 	 	 	 m i n u t e   =   ( i n t ) ( M a t h F l o o r ( T i m e C o m p o n e n t M i n u t e )   +   ( 6 0   *   ( T i m e C o m p o n e n t H o u r   -   M a t h F l o o r ( T i m e C o m p o n e n t H o u r ) ) ) ) ;  
 	 	 	 	 	 	 s e c o n d   =   ( i n t ) ( T i m e C o m p o n e n t S e c o n d   +   ( 6 0   *   ( T i m e C o m p o n e n t M i n u t e   -   M a t h F l o o r ( T i m e C o m p o n e n t M i n u t e ) ) ) ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 y e a r       =   T i m e Y e a r ( r e t v a l ) ;  
 	 	 	 	 	 	 m o n t h     =   T i m e M o n t h ( r e t v a l ) ;  
 	 	 	 	 	 	 d a y         =   T i m e D a y ( r e t v a l ) ;  
 	 	 	 	 	 	 h o u r       =   T i m e H o u r ( r e t v a l ) ;  
 	 	 	 	 	 	 m i n u t e   =   T i m e M i n u t e ( r e t v a l ) ;  
 	 	 	 	 	 	 s e c o n d   =   T i m e S e c o n d s ( r e t v a l ) ;  
 	 	 	 	 	 }  
 	 	  
 	 	 	 	 	 y e a r     =   y e a r   +   T i m e S h i f t Y e a r s   *   s h ;  
 	 	 	 	 	 m o n t h   =   m o n t h   +   T i m e S h i f t M o n t h s   *   s h ;  
 	 	  
 	 	 	 	 	           i f   ( m o n t h   <   0 )   { m o n t h   =   1 2   -   m o n t h ; }  
 	 	 	 	 	 e l s e   i f   ( m o n t h   >   1 2 )   { m o n t h   =   m o n t h   -   1 2 ; }  
 	 	  
 	 	 	 	 	 r e t v a l   =   S t r i n g T o T i m e ( I n t e g e r T o S t r i n g ( y e a r ) + " . " + I n t e g e r T o S t r i n g ( m o n t h ) + " . " + I n t e g e r T o S t r i n g ( d a y ) + "   " + I n t e g e r T o S t r i n g ( h o u r ) + " : " + I n t e g e r T o S t r i n g ( m i n u t e ) + " : " + I n t e g e r T o S t r i n g ( s e c o n d ) ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	  
 	 	 	 r e t v a l   =   r e t v a l   +   ( s h   *   ( ( 6 0 4 8 0 0   *   T i m e S h i f t W e e k s )   +   S e c o n d s F r o m C o m p o n e n t s ( T i m e S h i f t D a y s ,   T i m e S h i f t H o u r s ,   T i m e S h i f t M i n u t e s ,   T i m e S h i f t S e c o n d s ) ) ) ;  
 	 	  
 	 	 	 i f   ( T i m e S k i p W e e k d a y s   = =   t r u e )  
 	 	 	 {  
 	 	 	 	 i n t   w e e k d a y   =   T i m e D a y O f W e e k ( r e t v a l ) ;  
 	 	  
 	 	 	 	 i f   ( s h   >   0 )   {   / /   f o r w a r d  
 	 	 	 	 	           i f   ( w e e k d a y   = =   0 )   { r e t v a l   =   r e t v a l   +   8 6 4 0 0 ; }  
 	 	 	 	 	 e l s e   i f   ( w e e k d a y   = =   6 )   { r e t v a l   =   r e t v a l   +   1 7 2 8 0 0 ; }  
 	 	 	 	 }  
 	 	 	 	 e l s e   i f   ( s h   <   0 )   {   / /   b a c k  
 	 	 	 	 	           i f   ( w e e k d a y   = =   0 )   { r e t v a l   =   r e t v a l   -   1 7 2 8 0 0 ; }  
 	 	 	 	 	 e l s e   i f   ( w e e k d a y   = =   6 )   { r e t v a l   =   r e t v a l   -   8 6 4 0 0 ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 s m o d e s h i f t   =   M o d e T i m e S h i f t ;  
 	 	 M o d e T i m e 0     =   M o d e T i m e ;  
 	 	  
 	 	 r e t u r n   ( d a t e t i m e ) r e t v a l ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   0 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   0 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 4  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 4 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 5  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 5 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 6  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 6 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 7  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 7 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 8  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 8 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 9  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 9 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 0  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 0 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   F I L T E R "   ,   ( i n t ) 3 4 ,   ( i n t ) 0 ,   ( i n t ) 1 0 0 ,   ( i n t ) 0 ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 1  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 1 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 2  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 2 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 3  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 3 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 4  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 4 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   4 H R "   ,   ( s t r i n g ) " H 4 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 5  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 5 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 6  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 6 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 7  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 7 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 8  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 8 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 9  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 9 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 0  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 0 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 1  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 1 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 2  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 2 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L   D 1 "   ,   ( s t r i n g ) " D 1 " ,   ( i n t ) 1 0 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 3  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 3 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 4  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 4 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 5  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 5 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 6  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 6 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 7  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 7 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 8  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 8 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 9  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 9 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 0  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 0 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   G A N N   S S L "   ,   ( s t r i n g ) " C u r r e n t   t i m e   f r a m e " ,   ( i n t ) 1 3 ,   ( i n t ) M O D E _ L W M A ,   ( b o o l ) t r u e ,   ( s t r i n g ) " t u r n   o n   A l e r t   =   t r u e " ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) t r u e ,   ( b o o l ) f a l s e ,   ( s t r i n g ) " a l e r t . w a v " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " C a n d l e "   m o d e l  
 c l a s s   M D L I C _ c a n d l e s _ c a n d l e s  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   i O H L C ;  
 	 s t r i n g   M o d e C a n d l e F i n d B y ;  
 	 i n t   C a n d l e I D ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ c a n d l e s _ c a n d l e s ( )  
 	 {  
 	 	 i O H L C   =   ( s t r i n g ) " i C l o s e " ;  
 	 	 M o d e C a n d l e F i n d B y   =   ( s t r i n g ) " i d " ;  
 	 	 C a n d l e I D   =   ( i n t ) 0 ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 i n t   d i g i t s   =   ( i n t ) S y m b o l I n f o I n t e g e r ( S y m b o l ,   S Y M B O L _ D I G I T S ) ;  
 	 	  
 	 	 d o u b l e   O [ ] ;  
 	 	 d o u b l e   H [ ] ;  
 	 	 d o u b l e   L [ ] ;  
 	 	 d o u b l e   C [ ] ;    
 	 	 l o n g   c T i c k V o l u m e [ ] ;  
 	 	 l o n g   c R e a l V o l u m e [ ] ;  
 	 	 d a t e t i m e   T [ ] ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	  
 	 	 / /   c a n d l e ' s   i d   w i l l   c h a n g e ,   s o   w e   d o n ' t   w a n t   t o   m e s s   w i t h   t h e   v a r i a b l e   C a n d l e I D ;  
 	 	 i n t   c I D   =   C a n d l e I D ;  
 	 	  
 	 	 i f   ( M o d e C a n d l e F i n d B y   = =   " t i m e " )  
 	 	 {  
 	 	 	 c I D   =   i C a n d l e I D ( S y m b o l ,   P e r i o d ,   S t r i n g T o T i m e E x ( T i m e S t a m p ,   " s e r v e r " ) ) ;  
 	 	 }  
 	 	  
 	 	 c I D   =   c I D   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 / / - -   t h e   c o m m o n   l e v e l s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 i f   ( i O H L C   = =   " i O p e n " )  
 	 	 {  
 	 	 	 i f   ( C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1 )   r e t v a l   =   O [ 0 ] ;  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i H i g h " )  
 	 	 {  
 	 	 	 i f   ( C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1 )   r e t v a l   =   H [ 0 ] ;  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i L o w " )  
 	 	 {  
 	 	 	 i f   ( C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1 )   r e t v a l   =   L [ 0 ] ;  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i C l o s e " )  
 	 	 {  
 	 	 	 i f   ( C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1 )   r e t v a l   =   C [ 0 ] ;  
 	 	 }  
 	 	  
 	 	 / / - -   n o n - p r i c e   v a l u e s     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 e l s e   i f   ( i O H L C   = =   " i V o l u m e "   | |   i O H L C   = =   " i T i c k V o l u m e " )  
 	 	 {  
 	 	 	 i f   ( C o p y T i c k V o l u m e ( S y m b o l , P e r i o d , c I D , 1 , c T i c k V o l u m e )   >   - 1 )   r e t v a l   =   ( d o u b l e ) c T i c k V o l u m e [ 0 ] ;  
 	 	 	  
 	 	 	 r e t u r n   r e t v a l ;  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i R e a l V o l u m e " )  
 	 	 {  
 	 	 	 i f   ( C o p y R e a l V o l u m e ( S y m b o l , P e r i o d , c I D , 1 , c R e a l V o l u m e )   >   - 1 )   r e t v a l   =   ( d o u b l e ) c R e a l V o l u m e [ 0 ] ;  
 	 	 	  
 	 	 	 r e t u r n   r e t v a l ;  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i T i m e " )  
 	 	 {  
 	 	 	 i f   ( C o p y T i m e ( S y m b o l , P e r i o d , c I D , 1 , T )   >   - 1 )   r e t v a l   =   ( d o u b l e ) T [ 0 ] ;  
 	 	 	  
 	 	 	 r e t u r n   r e t v a l ;  
 	 	 }  
 	 	  
 	 	 / / - -   s i m p l e   c a l c u l a t i o n s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 e l s e   i f   ( i O H L C   = =   " i M e d i a n " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 	 & &   C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   ( ( L [ 0 ] + H [ 0 ] ) / 2 ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i T y p i c a l " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 	 & &   C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   ( ( L [ 0 ] + H [ 0 ] + C [ 0 ] ) / 3 ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i A v e r a g e " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 	 & &   C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   ( ( L [ 0 ] + H [ 0 ] + C [ 0 ] + C [ 0 ] ) / 4 ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 / / - -   m o r e   c o m p l e x   l e v e l s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 	 e l s e   i f   ( i O H L C = = " i T o t a l " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( M a t h A b s ( H [ 0 ] - L [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B o d y " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( M a t h A b s ( C [ 0 ] - O [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i U p p e r W i c k " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   ( C [ 0 ]   >   O [ 0 ] )   ?   t o P i p s ( M a t h A b s ( H [ 0 ] - C [ 0 ] ) , S y m b o l )   :   t o P i p s ( M a t h A b s ( H [ 0 ] - O [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B o t t o m W i c k " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   ( C [ 0 ]   >   O [ 0 ] )   ?   t o P i p s ( M a t h A b s ( O [ 0 ] - L [ 0 ] ) , S y m b o l )   :   t o P i p s ( M a t h A b s ( C [ 0 ] - L [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i G a p " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D + 1 , 1 , C )   >   - 1  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( M a t h A b s ( O [ 0 ] - C [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B u l l T o t a l " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   >   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( H [ 0 ] - L [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B u l l B o d y " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   >   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( C [ 0 ] - O [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B u l l U p p e r W i c k " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   >   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( H [ 0 ] - C [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B u l l B o t t o m W i c k " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 	 & &   C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   >   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( O [ 0 ] - L [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B e a r T o t a l " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   <   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( H [ 0 ] - L [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B e a r B o d y " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   <   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( O [ 0 ] - C [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B e a r U p p e r W i c k " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y H i g h ( S y m b o l , P e r i o d , c I D , 1 , H )   >   - 1  
 	 	 	 	 & &   C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   <   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( H [ 0 ] - O [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i O H L C   = =   " i B e a r B o t t o m W i c k " )  
 	 	 {  
 	 	 	 i f   (  
 	 	 	 	       C o p y L o w ( S y m b o l , P e r i o d , c I D , 1 , L )   >   - 1  
 	 	 	 	 & &   C o p y O p e n ( S y m b o l , P e r i o d , c I D , 1 , O )   >   - 1  
 	 	 	 	 & &   C o p y C l o s e ( S y m b o l , P e r i o d , c I D , 1 , C )   >   - 1  
 	 	 	 	 & &   C [ 0 ]   <   O [ 0 ]  
 	 	 	 )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   t o P i p s ( ( C [ 0 ] - L [ 0 ] ) , S y m b o l ) ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   N o r m a l i z e D o u b l e ( r e t v a l ,   d i g i t s ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 1  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 1 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   0 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 2  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 2 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   0 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 3  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 3 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 4  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 4 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   D S R - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 5  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 5 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   2 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 6  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 6 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   O S C I L L A T O R "   ,   ( b o o l ) f a l s e ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 7  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 7 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   0 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 8  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 8 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   0 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " ! X P S   v 8   R A N G E - t e s t "   ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 9  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 9 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   0 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " M y   I n d i c a t o r s "   m o d e l  
 c l a s s   M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 4 0  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   S y m b o l ;  
 	 E N U M _ T I M E F R A M E S   P e r i o d ;  
 	 s t r i n g   M o d e O u t p u t ;  
 	 s t r i n g   T i m e S t a m p ;  
 	 i n t   V i s i b l e I D ;  
 	 i n t   V i s i b l e S h i f t ;  
 	 i n t   V i s i b l e L i m i t ;  
 	 i n t   R a n g e C a n d l e S t a r t ;  
 	 i n t   R a n g e C a n d l e E n d ;  
 	 s t r i n g   R a n g e T i m e S o u r c e ;  
 	 s t r i n g   R a n g e T i m e S t a r t ;  
 	 s t r i n g   R a n g e T i m e E n d ;  
 	 d o u b l e   R a n g e D a y O f f s e t ;  
 	 s t r i n g   R a n g e V a l u e ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 4 0 ( )  
 	 {  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 	 M o d e O u t p u t   =   ( s t r i n g ) " i d " ;  
 	 	 T i m e S t a m p   =   ( s t r i n g ) " 0 0 : 0 0 " ;  
 	 	 V i s i b l e I D   =   ( i n t ) 0 ;  
 	 	 V i s i b l e S h i f t   =   ( i n t ) 0 ;  
 	 	 V i s i b l e L i m i t   =   ( i n t ) 1 0 0 ;  
 	 	 R a n g e C a n d l e S t a r t   =   ( i n t ) 0 ;  
 	 	 R a n g e C a n d l e E n d   =   ( i n t ) 1 0 ;  
 	 	 R a n g e T i m e S o u r c e   =   ( s t r i n g ) " s e r v e r " ;  
 	 	 R a n g e T i m e S t a r t   =   ( s t r i n g ) " 0 1 : 0 0 " ;  
 	 	 R a n g e T i m e E n d   =   ( s t r i n g ) " 0 8 : 0 0 " ;  
 	 	 R a n g e D a y O f f s e t   =   ( d o u b l e ) 0 . 0 ;  
 	 	 R a n g e V a l u e   =   ( s t r i n g ) " m a x " ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 / / ! ! !   I   m u s t   d e f i n e   a l l   i n p u t   p r o p e r t i e s   h e r e ,   b e c a u s e   t h e y   a r e   n o t   a u t o m a t i c a l l y   d e f i n e d .  
 	 	 / /   T h i s   f u n c t i o n   i s   n o t   g l o b a l   p r o t o t y p e ,   o n e   n e w   f u n c t i o n   i s   c r e a t e d   f o r   e a c h   c a s e .   T h i s   i s   b e c a u s e   %   i C u s t o m   %   m u s t   b e   u n i q u e  
 	 	  
 	 	 s t r i n g   s y m b o l   =   S y m b o l ;  
 	 	 E N U M _ T I M E F R A M E S   t i m e f r a m e   =   P e r i o d ;  
 	 	 i n t   b u f f e r         =   1 ;  
 	 	 i n t   s h i f t           =   S h i f t   +   F X D _ M O R E _ S H I F T ;  
 	 	  
 	 	 d o u b l e   r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 i n t   i ;  
 	 	 d o u b l e   i v a l ;  
 	 	  
 	 	 i f   ( M o d e O u t p u t   = =   " i d " )  
 	 	 {  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t ) ;  
 	 	 	  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   t i m e ;  
 	 	 	  
 	 	 	 i f   ( 0   & &   S t r i n g F i n d ( T i m e S t a m p ,   " : " )   = =   - 1 )  
 	 	 	 { 	  
 	 	 	 	 t i m e   =   ( d a t e t i m e ) S t r i n g T o I n t e g e r ( T i m e S t a m p ) ;   / /   h a n g s   i n   M Q L 4 ! ! !  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t i m e   =   S t r i n g T o T i m e ( T i m e S t a m p ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 s h i f t   =   i C a n d l e I D ( s y m b o l ,   t i m e f r a m e ,   t i m e ) ;  
 	 	 	 r e t v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t ) ;  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " v i s i b l e "   | |   M o d e O u t p u t   = =   " i d _ b y _ v i s i b l e " )  
 	 	 {  
 	 	 	 i f   ( V i s i b l e L i m i t   = =   0 )   { V i s i b l e L i m i t   =   i B a r s ( s y m b o l ,   t i m e f r a m e ) ; }  
 	 	 	  
 	 	 	 i n t   v i d   =   0 ;  
 	 	 	  
 	 	 	 f o r   ( i   =   s h i f t ;   i   < =   V i s i b l e L i m i t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	  
 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 i f   ( v i d   > =   V i s i b l e I D )   {  
 	 	 	 	 	 i f   ( M o d e O u t p u t   = =   " v i s i b l e " )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 	 e l s e   { r e t v a l   =   i ; }  
 	 	 	 	 	 b r e a k ; 	  
 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 v i d + + ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e " )  
 	 	 {  
 	 	 	 i n t   c s t a r t   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 i n t   c e n d       =   R a n g e C a n d l e E n d ;  
 	 	 	 / / s t r i n g   R a n g e V a l u e   =   R a n g e V a l u e ;  
 	 	 	  
 	 	 	 / /   r e v e r s e   v a l u e s ,   i f   n e e d e d  
 	 	 	 i f   ( R a n g e C a n d l e S t a r t   >   R a n g e C a n d l e E n d )   {  
 	 	 	 	 i n t   c t m p   =   R a n g e C a n d l e E n d ;  
 	 	 	 	 R a n g e C a n d l e E n d   =   R a n g e C a n d l e S t a r t ;  
 	 	 	 	 R a n g e C a n d l e S t a r t   =   c t m p ;  
 	 	 	 }  
 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i   =   R a n g e C a n d l e S t a r t ;   i   < =   R a n g e C a n d l e E n d ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( M o d e O u t p u t   = =   " r a n g e _ t i m e " )  
 	 	 {  
 	 	 	 d a t e t i m e   o f f s e t   =   0 ;  
 	 	 	 i f   ( R a n g e T i m e S o u r c e   = =   " g m t " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( )   +   T i m e G M T O f f s e t ( ) ) ; }  
 	 	 	 e l s e   i f   ( R a n g e T i m e S o u r c e   = =   " s e r v e r " )   { o f f s e t   =   ( i n t ) ( T i m e C u r r e n t ( )   -   T i m e L o c a l ( ) ) ; }  
 	 	 	  
 	 	 	 d a t e t i m e   t i m e 1   =   S t r i n g T o T i m e ( R a n g e T i m e S t a r t ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	 d a t e t i m e   t i m e 2   =   S t r i n g T o T i m e ( R a n g e T i m e E n d ) - ( d a t e t i m e ) ( 8 6 4 0 0 * R a n g e D a y O f f s e t )   +   o f f s e t ;  
 	 	 	  
 	 	 	 i n t   x 1   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 1 ,   f a l s e ) ;  
 	 	 	 i n t   x 2   =   i B a r S h i f t ( s y m b o l ,   t i m e f r a m e ,   t i m e 2 ,   f a l s e ) ;  
 	 	 	 i f   ( x 1 < x 2 )   { x 1 = i B a r S h i f t ( s y m b o l , t i m e f r a m e , ( t i m e 1 - 8 6 4 0 0 ) , f a l s e ) ; }  
 	 	 	  
 	 	 	 i f   ( R a n g e V a l u e   = =   " m a x " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   - E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   >   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( r e t v a l   = =   - E M P T Y _ V A L U E )   { r e t v a l   =   E M P T Y _ V A L U E ; }  
 	 	 	 }  
 	 	 	 e l s e   i f   ( R a n g e V a l u e   = =   " m i n " )  
 	 	 	 {  
 	 	 	 	 r e t v a l   =   E M P T Y _ V A L U E ;  
 	 	 	 	  
 	 	 	 	 f o r   ( i = x 2 ;   i < = x 1 ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i v a l   =   i C u s t o m ( s y m b o l ,   t i m e f r a m e ,   " S y n e r g y _ T r a d e S i g n a l "   ,   ( s t r i n g ) " S y n e r g y   T r a d e   S i g n a l " ,   ( s t r i n g ) " ©   2 0 0 8 ,   D e a n   M a l o n e " ,   ( s t r i n g ) " w w w . c o m p a s s f x . c o m " ,   ( s t r i n g ) " - - L o g i n   I n f o r m a t i o n - - " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( c o l o r ) W h i t e ,   ( i n t ) 2 ,   ( s t r i n g ) " E n t e r   0 ,   1 ,   2 ,   o r   3   t o   c h a n g e   c o r n e r s " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O n " ,   ( s t r i n g ) " O f f " ,   ( s t r i n g ) " O f f " ,   ( d o u b l e ) 0 . 0 ,   ( d o u b l e ) 0 . 0 ,   ( s t r i n g ) " I f   M y R a n g e F a c t o r   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 1 , M 5 = 0 . 0 2 , M 1 5 = 0 . 0 4 , M 3 0 = 0 . 0 6 , H 1 = 0 . 0 8 , H 4 = 0 . 1 4 , D 1 = 0 . 4 ) " ,   ( s t r i n g ) " I f   M y V o l a t i l i t y   =   0 . 0   -   D e f a u l t s   =   ( M 1 = 0 . 0 0 0 1 , M 5 = 0 . 0 0 0 2 , M 1 5 = 0 . 0 0 0 4 , M 3 0 = 0 . 0 0 0 6 , H 1 = 0 . 0 0 0 8 , H 4 = 0 . 0 0 1 4 , D 1 = 0 . 0 0 5 ) " ,   b u f f e r ,   s h i f t   +   i ) ;  
 	 	 	 	 	 i f   ( i v a l   = =   E M P T Y _ V A L U E   | |   i v a l   = =   0 )   { c o n t i n u e ; }  
 	 	 	 	 	 i f   ( i v a l   <   r e t v a l )   { r e t v a l   =   i v a l ; }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 r e t u r n   ( r e t v a l ) ;  
 	 }  
 } ;  
  
 / /   " A t t r i b u t e s   s e t   1   ( n u m e r i c ) "   m o d e l  
 c l a s s   M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T  
 {  
 	 p u b l i c :   / *   I n p u t   P a r a m e t e r s   * /  
 	 s t r i n g   O b j S o u r c e ;  
 	 s t r i n g   N a m e ;  
 	 i n t   P r o p e r t y ;  
 	 i n t   F i b o L e v e l I D ;  
 	 d o u b l e   T L p r i c e L e v e l ;  
 	 i n t   S h i f t ;  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   r )   { r e t u r n ; }  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T ( )  
 	 {  
 	 	 O b j S o u r c e   =   ( s t r i n g ) " n a m e " ;  
 	 	 N a m e   =   ( s t r i n g ) " m y _ o b j e c t _ n a m e " ;  
 	 	 P r o p e r t y   =   ( i n t ) O B J P R O P _ P R I C E 1 ;  
 	 	 F i b o L e v e l I D   =   ( i n t ) 0 ;  
 	 	 T L p r i c e L e v e l   =   ( d o u b l e ) 1 . 2 ;  
 	 	 S h i f t   =   ( i n t ) 0 ;  
 	 }  
  
 	 p u b l i c :   / *   T h e   m a i n   m e t h o d   * /  
 	 d o u b l e   _ e x e c u t e _ ( )  
 	 {  
 	 	 s t r i n g   n a m e   =   N a m e ;  
 	 	  
 	 	 i f   ( O b j S o u r c e   = =   " o b j l o o p " )   { n a m e   =   L o a d e d O b j e c t N a m e ( ) ; }  
 	 	 i f   ( O b j e c t F i n d ( 0 , n a m e ) < 0 )   { r e t u r n   E M P T Y _ V A L U E ; }  
 	 	  
 	 	 d o u b l e   r e t v a l   =   0 ;  
 	 	 i n t   m o d i f i e r     =   0 ;  
 	 	  
 	 	 d o u b l e   F i b o 1 0 0     =   0 ;  
 	 	 d o u b l e   F i b o 0         =   0 ;  
 	 	 d o u b l e   F i b o D i f f   =   0 ;  
 	 	  
 	 	           i f   ( P r o p e r t y   = =   O B J P R O P _ T I M E 1 )       { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ T I M E , 0 ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ T I M E 2 )       { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ T I M E , 1 ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ T I M E 3 )       { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ T I M E , 2 ) ; }  
 	 	  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ P R I C E 1 )     { r e t v a l   =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ P R I C E , 0 ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ P R I C E 2 )     { r e t v a l   =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ P R I C E , 1 ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ P R I C E 3 )     { r e t v a l   =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ P R I C E , 2 ) ; }  
 	 	  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ B A R S H I F T 1 )   { r e t v a l   =   i B a r S h i f t ( S y m b o l ( ) ,   P e r i o d ( ) ,   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ T I M E , 0 ) ,   t r u e ) ;   i f   ( r e t v a l = = - 1 )   { S k i p T h e P a s s ( t r u e ) ; } }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ B A R S H I F T 2 )   { r e t v a l   =   i B a r S h i f t ( S y m b o l ( ) ,   P e r i o d ( ) ,   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ T I M E , 1 ) ,   t r u e ) ;   i f   ( r e t v a l = = - 1 )   { S k i p T h e P a s s ( t r u e ) ; } }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ B A R S H I F T 3 )   { r e t v a l   =   i B a r S h i f t ( S y m b o l ( ) ,   P e r i o d ( ) ,   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ T I M E , 2 ) ,   t r u e ) ;   i f   ( r e t v a l = = - 1 )   { S k i p T h e P a s s ( t r u e ) ; } }  
 	 	  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ C O L O R )             { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ C O L O R ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ S T Y L E )             { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ S T Y L E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ W I D T H )             { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ W I D T H ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ B A C K )               { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ B A C K ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ R A Y _ L E F T )       { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ R A Y _ L E F T ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ R A Y _ R I G H T )     { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ R A Y _ R I G H T ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ R A Y )                 { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ R A Y ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ E L L I P S E )         { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ E L L I P S E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ A R R O W C O D E )     { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ A R R O W C O D E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ F O N T S I Z E )       { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ F O N T S I Z E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ C O R N E R )           { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ C O R N E R ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ X D I S T A N C E )     { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ X D I S T A N C E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ Y D I S T A N C E )     { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ Y D I S T A N C E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ L E V E L C O L O R )   { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ L E V E L C O L O R ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ L E V E L S T Y L E )   { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ L E V E L S T Y L E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ L E V E L W I D T H )   { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ L E V E L W I D T H ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ A N C H O R )           { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ A N C H O R ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ D I R E C T I O N )     { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ D I R E C T I O N ) ; }  
 	 	 / / e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ D E G R E E )           { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ D E G R E E ) ; }  
 	 	 / / e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ D R A W L I N E S )     { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ D R A W L I N E S ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ S T A T E )             { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ S T A T E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ X S I Z E )             { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ X S I Z E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ Y S I Z E )             { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ Y S I Z E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ P E R I O D )           { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ P E R I O D ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ L E V E L S )           { r e t v a l   =   ( i n t ) O b j e c t G e t I n t e g e r ( 0 , n a m e , O B J P R O P _ L E V E L S ) ; }  
 	 	  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ A N G L E )             { r e t v a l   =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ A N G L E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ S C A L E )             { r e t v a l   =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ S C A L E ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ D E V I A T I O N )     { r e t v a l   =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ D E V I A T I O N ) ; }  
 	 	  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ F I R S T L E V E L )                 { r e t v a l   =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ L E V E L V A L U E , F i b o L e v e l I D ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ T L _ P R I C E _ B Y _ S H I F T )   { r e t v a l   =   O b j e c t G e t V a l u e B y S h i f t ( n a m e ,   S h i f t + F X D _ M O R E _ S H I F T ) ; }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ T L _ S H I F T _ B Y _ P R I C E )   { r e t v a l   =   O b j e c t G e t S h i f t B y V a l u e ( n a m e , T L p r i c e L e v e l ) ; }  
 	 	  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ F I B O V A L U E )   {  
 	 	       F i b o 1 0 0     =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ P R I C E , 0 ) ;  
 	 	 	 F i b o 0         =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ P R I C E , 1 ) ;  
 	 	 	 F i b o D i f f   =   F i b o 1 0 0   -   F i b o 0 ;  
 	 	 	 r e t v a l = 0 ;  
 	 	 	 i f   ( F i b o D i f f   ! =   0 )   { r e t v a l   =   ( S y m b o l I n f o D o u b l e ( S y m b o l ( ) , S Y M B O L _ B I D ) - F i b o 0 ) / F i b o D i f f ; }  
 	 	 }  
 	 	 e l s e   i f   ( P r o p e r t y   = =   O B J P R O P _ F I B O P R I C E V A L U E )   {  
 	 	 	 F i b o 1 0 0     =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ P R I C E , 0 ) ;  
 	 	 	 F i b o 0         =   O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ P R I C E , 1 ) ;  
 	 	 	 F i b o D i f f   =   F i b o 1 0 0   -   F i b o 0 ;  
 	 	 	 r e t v a l = ( O b j e c t G e t D o u b l e ( 0 , n a m e , O B J P R O P _ L E V E L V A L U E , F i b o L e v e l I D ) * ( F i b o D i f f ) ) + F i b o 0 ;  
 	 	 }  
 	 	  
 	 	 r e t u r n   r e t v a l ;  
 	 }  
 } ;  
  
  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
  
 / /   B l o c k   1   ( P a s s )  
 c l a s s   B l o c k 0 :   p u b l i c   M D L _ P a s s  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 4 ]   =   { 1 , 1 1 , 2 , 3 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 ] . r u n ( 0 ) ;  
 	 	 	 _ b l o c k s _ [ 2 ] . r u n ( 0 ) ;  
 	 	 	 _ b l o c k s _ [ 3 ] . r u n ( 0 ) ;  
 	 	 	 _ b l o c k s _ [ 1 1 ] . r u n ( 0 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   2   ( T r a i l i n g   s t o p   ( e a c h   t r a d e ) )  
 c l a s s   B l o c k 1 :   p u b l i c   M D L _ T r a i l i n g S t o p 2 < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , i n t , i n t , s t r i n g , d o u b l e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 f t T P . V a l u e   =   0 . 0 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 G r o u p M o d e   =   " a l l " ;  
 	 	 G r o u p   =   " 2 " ;  
 	 	 S y m b o l M o d e   =   " a l l " ;  
 	 	 B u y s O r S e l l s   =   " s e l l s " ;  
 	 	 T r a i l i n g S t a r t M o d e   =   " f u n c t i o n " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ f t S t o p _ ( )   {  
 	 	 f t S t o p . V a l u e   =   v : : S E L L _ S L ;  
  
 	 	 r e t u r n   f t S t o p . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t D i g i t s _ ( )   {  
 	 	 f t D i g i t s . V a l u e   =   v : : S E L L _ S L ;  
  
 	 	 r e t u r n   f t D i g i t s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t S t a r t _ ( )   {  
 	 	 f t S t a r t . V a l u e   =   v : : T C H E C K _ S _ L I N E _ T O _ T C ;  
 	 	 f t S t a r t . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   f t S t a r t . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t S t a r t F r a c t i o n _ ( )   {  
 	 	 f t S t a r t F r a c t i o n . V a l u e   =   v : : T R A I L _ S E L L ;  
  
 	 	 r e t u r n   f t S t a r t F r a c t i o n . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t T P _ ( )   { r e t u r n   f t T P . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 t S t o p P i p s   =   ( d o u b l e ) v : : A T R _ S S L _ L I N E _ T O _ S L ;  
 	 	 L e v e l C o l o r   =   ( c o l o r ) c l r D e e p P i n k ;  
 	 }  
 } ;  
  
 / /   B l o c k   3   ( B r e a k   e v e n   p o i n t   ( e a c h   t r a d e ) )  
 c l a s s   B l o c k 2 :   p u b l i c   M D L _ B r e a k E v e n P o i n t < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , d o u b l e , d o u b l e , d o u b l e , s t r i n g , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 G r o u p M o d e   =   " a l l " ;  
 	 	 G r o u p   =   " 2 " ;  
 	 	 S y m b o l M o d e   =   " a l l " ;  
 	 	 B u y s O r S e l l s   =   " s e l l s " ;  
 	 	 B E P o f f s e t P i p s   =   5 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 O n P r o f i t P i p s   =   ( d o u b l e ) v : : S E L L _ T P ;  
 	 }  
 } ;  
  
 / /   B l o c k   4   ( T r a i l i n g   s t o p   ( e a c h   t r a d e ) )  
 c l a s s   B l o c k 3 :   p u b l i c   M D L _ T r a i l i n g S t o p 2 < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , i n t , i n t , s t r i n g , d o u b l e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , s t r i n g , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 f t S t a r t F r a c t i o n . M o d e V a l u e   =   0 ;  
 	 	 f t T P . V a l u e   =   0 . 0 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 G r o u p M o d e   =   " a l l " ;  
 	 	 S y m b o l M o d e   =   " a l l " ;  
 	 	 B u y s O r S e l l s   =   " b u y s " ;  
 	 	 T r a i l i n g S t a r t M o d e   =   " f u n c t i o n " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ f t S t o p _ ( )   {  
 	 	 f t S t o p . V a l u e   =   v : : S L ;  
  
 	 	 r e t u r n   f t S t o p . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t D i g i t s _ ( )   {  
 	 	 f t D i g i t s . V a l u e   =   v : : S L ;  
  
 	 	 r e t u r n   f t D i g i t s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t S t a r t _ ( )   {  
 	 	 f t S t a r t . V a l u e   =   v : : T C H E C K _ L I N E _ T O _ T C ;  
 	 	 f t S t a r t . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   f t S t a r t . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t S t a r t F r a c t i o n _ ( )   {  
 	 	 f t S t a r t F r a c t i o n . V a l u e   =   v : : T C H E C K ;  
 	 	 f t S t a r t F r a c t i o n . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   f t S t a r t F r a c t i o n . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ f t T P _ ( )   { r e t u r n   f t T P . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 t S t o p P i p s   =   ( d o u b l e ) v : : A T R _ S L _ L I N E _ T O _ S L ;  
 	 	 L e v e l C o l o r   =   ( c o l o r ) c l r D e e p P i n k ;  
 	 }  
 } ;  
  
 / /   B l o c k   5   ( M o d i f y   V a r i a b l e s )  
 c l a s s   B l o c k 4 :   p u b l i c   M D L _ M o d i f y V a r i a b l e s < i n t , M D L I C _ i n d i c a t o r s _ i A T R , d o u b l e , i n t , M D L I C _ i n d i c a t o r s _ i A T R , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t , M D L I C _ v a l u e _ p o i n t s , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 V a l u e 4 . M o d e V a l u e   =   0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ V a l u e 1 _ ( )   {  
 	 	 V a l u e 1 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 V a l u e 1 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 d o u b l e   v a l u e   =   ( d o u b l e ) V a l u e 1 . _ e x e c u t e _ ( ) ;  
 	 	 v a l u e   =   v a l u e * ( 0 . 1 / P o i n t ( ) ) ;   / /   A d j u s t   t h e   v a l u e  
 	 	 r e t u r n   v a l u e ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 2 _ ( )   {  
 	 	 V a l u e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 V a l u e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 d o u b l e   v a l u e   =   ( d o u b l e ) V a l u e 2 . _ e x e c u t e _ ( ) ;  
 	 	 v a l u e   =   v a l u e * ( 0 . 1 / P o i n t ( ) ) * 1 . 5 ;   / /   A d j u s t   t h e   v a l u e  
 	 	 r e t u r n   v a l u e ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 3 _ ( )   {  
 	 	 V a l u e 3 . V a l u e   =   v : : S L ;  
  
 	 	 r e t u r n   V a l u e 3 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 4 _ ( )   {  
 	 	 V a l u e 4 . V a l u e   =   v : : T P ;  
 	 	 V a l u e 4 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 d o u b l e   v a l u e   =   ( d o u b l e ) V a l u e 4 . _ e x e c u t e _ ( ) ;  
 	 	 v a l u e   =   v a l u e * 2 ;   / /   A d j u s t   t h e   v a l u e  
 	 	 r e t u r n   v a l u e ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 5 _ ( )   { r e t u r n   V a l u e 5 . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 2 ] . r u n ( 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 v : : T P   =   _ V a l u e 1 _ ( ) ;  
 	 	 v : : S L   =   _ V a l u e 2 _ ( ) ;  
 	 	 v : : T R A I L   =   _ V a l u e 3 _ ( ) ;  
 	 	 v : : T C H E C K   =   _ V a l u e 4 _ ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   6   ( B u y   n o w )  
 c l a s s   B l o c k 5 :   p u b l i c   M D L _ B u y N o w < s t r i n g , s t r i n g , s t r i n g , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , d o u b l e , d o u b l e , i n t , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , i n t , i n t , d o u b l e , b o o l , d o u b l e , d o u b l e , b o o l , d o u b l e , s t r i n g , b o o l , d o u b l e , s t r i n g , s t r i n g , b o o l , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , i n t , i n t , i n t , M D L I C _ v a l u e _ t i m e , d a t e t i m e , u l o n g , s t r i n g , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 6 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 d V o l u m e S i z e . V a l u e   =   0 . 1 ;  
 	 	 d p T a k e P r o f i t . V a l u e   =   1 0 0 . 0 ;  
 	 	 d d T a k e P r o f i t . V a l u e   =   0 . 0 1 ;  
 	 	 d E x p . M o d e T i m e S h i f t   =   2 ;  
 	 	 d E x p . T i m e S h i f t D a y s   =   1 . 0 ;  
 	 	 d E x p . T i m e S k i p W e e k d a y s   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 V o l u m e S i z e   =   0 . 0 1 ;  
 	 	 V o l u m e R i s k   =   1 . 0 ;  
 	 	 S t o p L o s s M o d e   =   " d y n a m i c P i p s " ;  
 	 	 T a k e P r o f i t M o d e   =   " n o n e " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ d V o l u m e S i z e _ ( )   { r e t u r n   d V o l u m e S i z e . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d l S t o p L o s s _ ( )   {  
 	 	 d l S t o p L o s s . V a l u e   =   v : : S L ;  
  
 	 	 r e t u r n   d l S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d p S t o p L o s s _ ( )   {  
 	 	 d p S t o p L o s s . V a l u e   =   v : : S L ;  
  
 	 	 r e t u r n   d p S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d d S t o p L o s s _ ( )   {  
 	 	 d d S t o p L o s s . V a l u e   =   v : : S L ;  
  
 	 	 r e t u r n   d d S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d l T a k e P r o f i t _ ( )   { r e t u r n   d l T a k e P r o f i t . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d p T a k e P r o f i t _ ( )   { r e t u r n   d p T a k e P r o f i t . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d d T a k e P r o f i t _ ( )   { r e t u r n   d d T a k e P r o f i t . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d a t e t i m e   _ d E x p _ ( )   { r e t u r n   d E x p . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 A r r o w C o l o r B u y   =   ( c o l o r ) c l r B l u e ;  
 	 }  
 } ;  
  
 / /   B l o c k   7   ( S e l l   n o w )  
 c l a s s   B l o c k 6 :   p u b l i c   M D L _ S e l l N o w < s t r i n g , s t r i n g , s t r i n g , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , d o u b l e , d o u b l e , i n t , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , i n t , i n t , d o u b l e , b o o l , d o u b l e , d o u b l e , b o o l , d o u b l e , s t r i n g , b o o l , d o u b l e , s t r i n g , s t r i n g , b o o l , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , i n t , i n t , i n t , M D L I C _ v a l u e _ t i m e , d a t e t i m e , u l o n g , s t r i n g , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 d V o l u m e S i z e . V a l u e   =   0 . 1 ;  
 	 	 d E x p . M o d e T i m e S h i f t   =   2 ;  
 	 	 d E x p . T i m e S h i f t D a y s   =   1 . 0 ;  
 	 	 d E x p . T i m e S k i p W e e k d a y s   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 V o l u m e M o d e   =   " e q u i t y R i s k " ;  
 	 	 V o l u m e R i s k   =   0 . 0 1 ;  
 	 	 S t o p L o s s M o d e   =   " d y n a m i c P i p s " ;  
 	 	 T a k e P r o f i t M o d e   =   " d y n a m i c P i p s " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ d V o l u m e S i z e _ ( )   { r e t u r n   d V o l u m e S i z e . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d l S t o p L o s s _ ( )   { r e t u r n   d l S t o p L o s s . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d p S t o p L o s s _ ( )   {  
 	 	 d p S t o p L o s s . V a l u e   =   v : : A T R _ S S L _ L I N E _ T O _ S L ;  
 	 	 d p S t o p L o s s . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   d p S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d d S t o p L o s s _ ( )   {  
 	 	 d d S t o p L o s s . V a l u e   =   v : : S E L L _ S L ;  
  
 	 	 r e t u r n   d d S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d l T a k e P r o f i t _ ( )   { r e t u r n   d l T a k e P r o f i t . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d p T a k e P r o f i t _ ( )   {  
 	 	 d p T a k e P r o f i t . V a l u e   =   v : : A T R _ S T P _ L I N E _ T O _ T P ;  
 	 	 d p T a k e P r o f i t . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   d p T a k e P r o f i t . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d d T a k e P r o f i t _ ( )   {  
 	 	 d d T a k e P r o f i t . V a l u e   =   v : : S E L L _ T P ;  
  
 	 	 r e t u r n   d d T a k e P r o f i t . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ d E x p _ ( )   { r e t u r n   d E x p . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 A r r o w C o l o r S e l l   =   ( c o l o r ) c l r R e d ;  
 	 }  
 } ;  
  
 / /   B l o c k   8   ( S e l l   n o w )  
 c l a s s   B l o c k 7 :   p u b l i c   M D L _ S e l l N o w < s t r i n g , s t r i n g , s t r i n g , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , d o u b l e , d o u b l e , i n t , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , i n t , i n t , d o u b l e , b o o l , d o u b l e , d o u b l e , b o o l , d o u b l e , s t r i n g , b o o l , d o u b l e , s t r i n g , s t r i n g , b o o l , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , i n t , i n t , i n t , M D L I C _ v a l u e _ t i m e , d a t e t i m e , u l o n g , s t r i n g , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 d V o l u m e S i z e . V a l u e   =   0 . 1 ;  
 	 	 d p T a k e P r o f i t . V a l u e   =   1 0 0 . 0 ;  
 	 	 d d T a k e P r o f i t . V a l u e   =   0 . 0 1 ;  
 	 	 d E x p . M o d e T i m e S h i f t   =   2 ;  
 	 	 d E x p . T i m e S h i f t D a y s   =   1 . 0 ;  
 	 	 d E x p . T i m e S k i p W e e k d a y s   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 V o l u m e M o d e   =   " e q u i t y R i s k " ;  
 	 	 V o l u m e R i s k   =   0 . 0 1 ;  
 	 	 S t o p L o s s M o d e   =   " d y n a m i c D i g i t s " ;  
 	 	 T a k e P r o f i t M o d e   =   " n o n e " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ d V o l u m e S i z e _ ( )   { r e t u r n   d V o l u m e S i z e . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d l S t o p L o s s _ ( )   { r e t u r n   d l S t o p L o s s . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d p S t o p L o s s _ ( )   {  
 	 	 d p S t o p L o s s . V a l u e   =   v : : S E L L _ T P ;  
 	 	 d p S t o p L o s s . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   d p S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d d S t o p L o s s _ ( )   {  
 	 	 d d S t o p L o s s . V a l u e   =   v : : S E L L _ T P ;  
  
 	 	 r e t u r n   d d S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d l T a k e P r o f i t _ ( )   { r e t u r n   d l T a k e P r o f i t . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d p T a k e P r o f i t _ ( )   { r e t u r n   d p T a k e P r o f i t . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d d T a k e P r o f i t _ ( )   { r e t u r n   d d T a k e P r o f i t . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d a t e t i m e   _ d E x p _ ( )   { r e t u r n   d E x p . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 A r r o w C o l o r S e l l   =   ( c o l o r ) c l r R e d ;  
 	 }  
 } ;  
  
 / /   B l o c k   9   ( B u y   n o w )  
 c l a s s   B l o c k 8 :   p u b l i c   M D L _ B u y N o w < s t r i n g , s t r i n g , s t r i n g , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , d o u b l e , d o u b l e , i n t , d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , i n t , i n t , d o u b l e , b o o l , d o u b l e , d o u b l e , b o o l , d o u b l e , s t r i n g , b o o l , d o u b l e , s t r i n g , s t r i n g , b o o l , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , s t r i n g , d o u b l e , d o u b l e , d o u b l e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , M D L I C _ v a l u e _ p o i n t s , d o u b l e , s t r i n g , i n t , i n t , i n t , M D L I C _ v a l u e _ t i m e , d a t e t i m e , u l o n g , s t r i n g , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 d V o l u m e S i z e . V a l u e   =   0 . 1 ;  
 	 	 d E x p . M o d e T i m e S h i f t   =   2 ;  
 	 	 d E x p . T i m e S h i f t D a y s   =   1 . 0 ;  
 	 	 d E x p . T i m e S k i p W e e k d a y s   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 V o l u m e S i z e   =   0 . 0 1 ;  
 	 	 V o l u m e R i s k   =   1 . 0 ;  
 	 	 S t o p L o s s M o d e   =   " d y n a m i c P i p s " ;  
 	 	 T a k e P r o f i t M o d e   =   " d y n a m i c P i p s " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ d V o l u m e S i z e _ ( )   { r e t u r n   d V o l u m e S i z e . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ d l S t o p L o s s _ ( )   {  
 	 	 d l S t o p L o s s . V a l u e   =   v : : S L ;  
  
 	 	 r e t u r n   d l S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d p S t o p L o s s _ ( )   {  
 	 	 d p S t o p L o s s . V a l u e   =   v : : A T R _ S L _ L I N E _ T O _ S L ;  
 	 	 d p S t o p L o s s . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   d p S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d d S t o p L o s s _ ( )   {  
 	 	 d d S t o p L o s s . V a l u e   =   v : : S L ;  
 	 	 d d S t o p L o s s . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   d d S t o p L o s s . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d l T a k e P r o f i t _ ( )   {  
 	 	 d l T a k e P r o f i t . V a l u e   =   v : : T P ;  
  
 	 	 r e t u r n   d l T a k e P r o f i t . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d p T a k e P r o f i t _ ( )   {  
 	 	 d p T a k e P r o f i t . V a l u e   =   v : : A T R _ T P _ L I N E _ T O _ T P ;  
 	 	 d p T a k e P r o f i t . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   d p T a k e P r o f i t . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ d d T a k e P r o f i t _ ( )   {  
 	 	 d d T a k e P r o f i t . V a l u e   =   v : : T P ;  
 	 	 d d T a k e P r o f i t . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   d d T a k e P r o f i t . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ d E x p _ ( )   { r e t u r n   d E x p . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 A r r o w C o l o r B u y   =   ( c o l o r ) c l r B l u e ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 0   ( M o d i f y   V a r i a b l e s )  
 c l a s s   B l o c k 9 :   p u b l i c   M D L _ M o d i f y V a r i a b l e s < i n t , M D L I C _ i n d i c a t o r s _ i A T R , d o u b l e , i n t , M D L I C _ i n d i c a t o r s _ i A T R , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t , M D L I C _ v a l u e _ p o i n t s , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 0 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 9 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 V a l u e 4 . M o d e V a l u e   =   0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ V a l u e 1 _ ( )   {  
 	 	 V a l u e 1 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 V a l u e 1 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 d o u b l e   v a l u e   =   ( d o u b l e ) V a l u e 1 . _ e x e c u t e _ ( ) ;  
 	 	 v a l u e   =   v a l u e * ( 0 . 1 / P o i n t ( ) ) ;   / /   A d j u s t   t h e   v a l u e  
 	 	 r e t u r n   v a l u e ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 2 _ ( )   {  
 	 	 V a l u e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 V a l u e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 d o u b l e   v a l u e   =   ( d o u b l e ) V a l u e 2 . _ e x e c u t e _ ( ) ;  
 	 	 v a l u e   =   v a l u e * ( 0 . 1 / P o i n t ( ) ) * 1 . 5 ;   / /   A d j u s t   t h e   v a l u e  
 	 	 r e t u r n   v a l u e ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 3 _ ( )   {  
 	 	 V a l u e 3 . V a l u e   =   v : : S E L L _ S L ;  
  
 	 	 r e t u r n   V a l u e 3 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 4 _ ( )   {  
 	 	 V a l u e 4 . V a l u e   =   v : : S E L L _ T P ;  
 	 	 V a l u e 4 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 d o u b l e   v a l u e   =   ( d o u b l e ) V a l u e 4 . _ e x e c u t e _ ( ) ;  
 	 	 v a l u e   =   v a l u e * 2 ;   / /   A d j u s t   t h e   v a l u e  
 	 	 r e t u r n   v a l u e ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 5 _ ( )   { r e t u r n   V a l u e 5 . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 9 ] . r u n ( 9 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 v : : S E L L _ T P   =   _ V a l u e 1 _ ( ) ;  
 	 	 v : : S E L L _ S L   =   _ V a l u e 2 _ ( ) ;  
 	 	 v : : T R A I L _ S E L L   =   _ V a l u e 3 _ ( ) ;  
 	 	 v : : T C H E C K _ S E L L   =   _ V a l u e 4 _ ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 1   ( N o   t r a d e )  
 c l a s s   B l o c k 1 0 :   p u b l i c   M D L _ N o O p e n e d O r d e r s < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 1 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 3 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 G r o u p M o d e   =   " a l l " ;  
 	 	 G r o u p   =   " 2 " ;  
 	 	 S y m b o l M o d e   =   " a l l " ;  
 	 	 B u y s O r S e l l s   =   " b u y s " ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 3 ] . r u n ( 1 0 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 2   ( B r e a k   e v e n   p o i n t   ( e a c h   t r a d e ) )  
 c l a s s   B l o c k 1 1 :   p u b l i c   M D L _ B r e a k E v e n P o i n t < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , d o u b l e , d o u b l e , d o u b l e , s t r i n g , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 2 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 G r o u p M o d e   =   " a l l " ;  
 	 	 G r o u p   =   " 1 " ;  
 	 	 S y m b o l M o d e   =   " a l l " ;  
 	 	 B u y s O r S e l l s   =   " b u y s " ;  
 	 	 B E P o f f s e t P i p s   =   5 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 O n P r o f i t P i p s   =   ( d o u b l e ) v : : T P ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 3   ( N o   t r a d e )  
 c l a s s   B l o c k 1 2 :   p u b l i c   M D L _ N o O p e n e d O r d e r s < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 3 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 G r o u p M o d e   =   " a l l " ;  
 	 	 G r o u p   =   " 2 " ;  
 	 	 S y m b o l M o d e   =   " a l l " ;  
 	 	 B u y s O r S e l l s   =   " s e l l s " ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 4 ] . r u n ( 1 2 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 4   ( I f   t r a d e )  
 c l a s s   B l o c k 1 3 :   p u b l i c   M D L _ I f O p e n e d O r d e r s < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 4 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 2 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 B u y s O r S e l l s   =   " b u y s " ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 4 ] . r u n ( 1 3 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 5   ( I f   t r a d e )  
 c l a s s   B l o c k 1 4 :   p u b l i c   M D L _ I f O p e n e d O r d e r s < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 2 3 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 B u y s O r S e l l s   =   " s e l l s " ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 3 ] . r u n ( 1 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 6   ( C l o s e   t r a d e s )  
 c l a s s   B l o c k 1 5 :   p u b l i c   M D L _ C l o s e O p e n e d < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , i n t , u l o n g , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 6 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 B u y s O r S e l l s   =   " b u y s " ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 A r r o w C o l o r   =   ( c o l o r ) c l r D e e p P i n k ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 7   ( C l o s e   t r a d e s )  
 c l a s s   B l o c k 1 6 :   p u b l i c   M D L _ C l o s e O p e n e d < s t r i n g , s t r i n g , s t r i n g , s t r i n g , s t r i n g , i n t , u l o n g , c o l o r >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 7 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 B u y s O r S e l l s   =   " s e l l s " ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 A r r o w C o l o r   =   ( c o l o r ) c l r D e e p P i n k ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 8   ( C o n d i t i o n )  
 c l a s s   B l o c k 1 7 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 , d o u b l e , s t r i n g , M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 8 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 1 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . S h i f t   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 1 ] . r u n ( 1 7 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 L o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 L o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 	 R o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 R o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   1 9   ( C o n d i t i o n )  
 c l a s s   B l o c k 1 8 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 , d o u b l e , s t r i n g , M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 4 , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 1 9 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . S h i f t   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " < " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 2 ] . r u n ( 1 8 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 L o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 L o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 	 R o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 R o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 0   ( C o n d i t i o n )  
 c l a s s   B l o c k 1 9 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 5 , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 1 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   1 9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 0 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 2 1 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " = = " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   { r e t u r n   R o . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 1 ] . r u n ( 1 9 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 L o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 L o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 1   ( C o n d i t i o n )  
 c l a s s   B l o c k 2 0 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 6 , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 1 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 2 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " = = " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   { r e t u r n   R o . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 2 ] . r u n ( 2 0 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 L o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 L o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 2   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 2 1 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 7 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 2 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 2 5 , 2 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 5 ] . r u n ( 2 1 ) ;  
 	 	 	 _ b l o c k s _ [ 2 6 ] . r u n ( 2 1 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 3   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 2 2 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 8 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 3 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 2 7 , 2 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 7 ] . r u n ( 2 2 ) ;  
 	 	 	 _ b l o c k s _ [ 2 8 ] . r u n ( 2 2 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 4   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 2 3 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 9 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 4 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 0 ] . r u n ( 2 3 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 5   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 2 4 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 0 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 9 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 9 ] . r u n ( 2 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 6   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 2 5 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 1 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 6 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 2 9 , 3 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 9 ] . r u n ( 2 5 ) ;  
 	 	 	 _ b l o c k s _ [ 3 0 ] . r u n ( 2 5 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 7   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 2 6 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 2 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 7 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 3 3 , 3 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 3 3 ] . r u n ( 2 6 ) ;  
 	 	 	 _ b l o c k s _ [ 3 4 ] . r u n ( 2 6 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 8   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 2 7 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 3 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 8 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 3 1 , 3 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 3 1 ] . r u n ( 2 7 ) ;  
 	 	 	 _ b l o c k s _ [ 3 2 ] . r u n ( 2 7 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   2 9   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 2 8 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 4 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 2 9 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 3 5 , 3 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 3 5 ] . r u n ( 2 8 ) ;  
 	 	 	 _ b l o c k s _ [ 3 6 ] . r u n ( 2 8 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 0   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 2 9 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 5 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 2 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   2 9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 0 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 4 1 , 4 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 1 ] . r u n ( 2 9 ) ;  
 	 	 	 _ b l o c k s _ [ 4 2 ] . r u n ( 2 9 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 1   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 3 0 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 6 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 1 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 4 1 , 4 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 1 ] . r u n ( 3 0 ) ;  
 	 	 	 _ b l o c k s _ [ 4 2 ] . r u n ( 3 0 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 2   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 3 1 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 7 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 2 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 3 7 , 3 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 3 7 ] . r u n ( 3 1 ) ;  
 	 	 	 _ b l o c k s _ [ 3 8 ] . r u n ( 3 1 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 3   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 3 2 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 8 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 3 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 3 7 , 3 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 3 7 ] . r u n ( 3 2 ) ;  
 	 	 	 _ b l o c k s _ [ 3 8 ] . r u n ( 3 2 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 4   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 3 3 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 1 9 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 4 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 4 3 , 4 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 3 ] . r u n ( 3 3 ) ;  
 	 	 	 _ b l o c k s _ [ 4 4 ] . r u n ( 3 3 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 5   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 3 4 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 0 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 4 3 , 4 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 3 ] . r u n ( 3 4 ) ;  
 	 	 	 _ b l o c k s _ [ 4 4 ] . r u n ( 3 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 6   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 3 5 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 1 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 6 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 3 9 , 4 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 3 9 ] . r u n ( 3 5 ) ;  
 	 	 	 _ b l o c k s _ [ 4 0 ] . r u n ( 3 5 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 7   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 3 6 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 2 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 7 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 3 9 , 4 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 3 9 ] . r u n ( 3 6 ) ;  
 	 	 	 _ b l o c k s _ [ 4 0 ] . r u n ( 3 6 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 8   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 3 7 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 3 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 8 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 7 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 7 ] . r u n ( 3 7 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   3 9   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 3 8 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 4 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 3 9 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 7 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 7 ] . r u n ( 3 8 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 0   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 3 9 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 5 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 3 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   3 9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 0 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 8 ] . r u n ( 3 9 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 1   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 4 0 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 6 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 1 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 8 ] . r u n ( 4 0 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 2   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 4 1 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 7 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 2 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 5 ] . r u n ( 4 1 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 3   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 4 2 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 8 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 3 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 5 ] . r u n ( 4 2 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 4   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 4 3 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 2 9 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 4 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 6 ] . r u n ( 4 3 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 5   ( I n d i c a t o r   i s   i n v i s i b l e )  
 c l a s s   B l o c k 4 4 :   p u b l i c   M D L _ I n d i c a t o r I s I n v i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 0 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 4 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 6 ] . r u n ( 4 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 6   ( C o n d i t i o n )  
 c l a s s   B l o c k 4 5 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 1 , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 6 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 7 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 7 ] . r u n ( 4 5 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 R o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 R o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 7   ( C o n d i t i o n )  
 c l a s s   B l o c k 4 6 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 2 , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 7 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 8 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 8 0 ] . r u n ( 4 6 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 R o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 R o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 8   ( C o n d i t i o n )  
 c l a s s   B l o c k 4 7 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 3 , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 8 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 8 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " < " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 8 2 ] . r u n ( 4 7 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 R o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 R o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   4 9   ( C o n d i t i o n )  
 c l a s s   B l o c k 4 8 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 4 , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 4 9 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 8 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " < " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 8 4 ] . r u n ( 4 8 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 R o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 R o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   5 0   ( C o n d i t i o n )  
 c l a s s   B l o c k 4 9 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 5 , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 4 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   4 9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 0 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 1 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " = = " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   { r e t u r n   R o . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 5 ] . r u n ( 4 9 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 L o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 L o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   5 1   ( C o n d i t i o n )  
 c l a s s   B l o c k 5 0 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 6 , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 1 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 1 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " = = " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   { r e t u r n   R o . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 6 ] . r u n ( 5 0 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 L o . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 L o . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   5 2   ( I n d i c a t o r   r i s e )  
 c l a s s   B l o c k 5 1 :   p u b l i c   M D L _ I n d i c a t o r R i s e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 7 , d o u b l e , s t r i n g , i n t , i n t , d o u b l e , d o u b l e , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 2 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 1 9 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 R i s e M o d e   =   " v a l u e " ;  
 	 	 R i s e C a n d l e s   =   1 ;  
 	 	 R i s e V a l u e   =   0 . 0 2 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 9 ] . r u n ( 5 1 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   5 3   ( I n d i c a t o r   f a l l )  
 c l a s s   B l o c k 5 2 :   p u b l i c   M D L _ I n d i c a t o r F a l l < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 8 , d o u b l e , s t r i n g , i n t , i n t , d o u b l e , d o u b l e , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 3 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 2 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 F a l l M o d e   =   " v a l u e " ;  
 	 	 F a l l C a n d l e s   =   1 ;  
 	 	 F a l l V a l u e   =   0 . 0 2 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 2 0 ] . r u n ( 5 2 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   5 4   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 5 3 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 3 9 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 4 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 1 7 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 7 ] . r u n ( 5 3 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   5 5   ( I n d i c a t o r   i s   v i s i b l e )  
 c l a s s   B l o c k 5 4 :   p u b l i c   M D L _ I n d i c a t o r I s V i s i b l e < M D L I C _ m y i n d i c a t o r s _ m y i n d i c a t o r s _ 4 0 , d o u b l e , i n t , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 1 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 I n d i c a t o r . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ I n d i c a t o r _ ( )   {  
 	 	 I n d i c a t o r . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 I n d i c a t o r . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   I n d i c a t o r . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 8 ] . r u n ( 5 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 / *   I n p u t s ,   m o d i f i e d   i n t o   t h e   c o d e   m u s t   b e   s e t   h e r e   e v e r y   t i m e   * /  
 	 	 I n d i c a t o r . R a n g e C a n d l e S t a r t   =   0 ;  
 	 	 I n d i c a t o r . R a n g e C a n d l e E n d   =   1 0 ;  
 	 }  
 } ;  
  
 / /   B l o c k   5 8   ( F o r m u l a )  
 c l a s s   B l o c k 5 5 :   p u b l i c   M D L _ F o r m u l a _ 1 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ i n d i c a t o r s _ i A T R , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 8 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 6 ] . r u n ( 5 5 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   5 9   ( F o r m u l a )  
 c l a s s   B l o c k 5 6 :   p u b l i c   M D L _ F o r m u l a _ 2 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ i n d i c a t o r s _ i A T R , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 5 9 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 3 ]   =   { 4 , 7 8 , 9 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 R o . S h i f t   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " - " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 R o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 4 ] . r u n ( 5 6 ) ;  
 	 	 	 _ b l o c k s _ [ 9 ] . r u n ( 5 6 ) ;  
 	 	 	 _ b l o c k s _ [ 7 8 ] . r u n ( 5 6 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   6 0   ( C o n d i t i o n )  
 c l a s s   B l o c k 5 7 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 6 0 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " < " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ T O P ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 8 ] . r u n ( 5 7 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   6 1   ( C o n d i t i o n )  
 c l a s s   B l o c k 5 8 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 6 1 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ B O T T O M ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 8 ] . r u n ( 5 8 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   7 0   ( D r a w   L i n e )  
 c l a s s   B l o c k 5 9 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 5 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   5 9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 0 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 	 O b j R a y L e f t   =   t r u e ;  
 	 	 O b j R a y R i g h t   =   t r u e ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : A T R _ T O P ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 0 ] . r u n ( 5 9 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r Y e l l o w ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   7 1   ( D r a w   L i n e )  
 c l a s s   B l o c k 6 0 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 1 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 	 O b j R a y L e f t   =   t r u e ;  
 	 	 O b j R a y R i g h t   =   t r u e ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : A T R _ B O T T O M ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r Y e l l o w ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   7 2   ( O n c e   p e r   t i c k )  
 c l a s s   B l o c k 6 1 :   p u b l i c   M D L _ O n c e P e r T i c k < s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 2 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 3 ]   =   { 1 3 , 1 4 , 5 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 3 ] . r u n ( 6 1 ) ;  
 	 	 	 _ b l o c k s _ [ 1 4 ] . r u n ( 6 1 ) ;  
 	 	 	 _ b l o c k s _ [ 5 5 ] . r u n ( 6 1 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   7 3   ( F o r m u l a )  
 c l a s s   B l o c k 6 2 :   p u b l i c   M D L _ F o r m u l a _ 3 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ p o i n t s , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 3 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 3 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : T P ;  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 3 ] . r u n ( 6 2 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   7 4   ( F o r m u l a )  
 c l a s s   B l o c k 6 3 :   p u b l i c   M D L _ F o r m u l a _ 4 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ p o i n t s , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 4 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 7 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " - " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : S L ;  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 7 ] . r u n ( 6 3 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   7 5   ( D r a w   L i n e )  
 c l a s s   B l o c k 6 4 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j N a m e   =   " T P L I N E " ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : A T R _ T P _ L I N E ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 5 ] . r u n ( 6 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r C a d e t B l u e ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   7 6   ( D r a w   L i n e )  
 c l a s s   B l o c k 6 5 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 6 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j N a m e   =   " S L L I N E " ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : A T R _ S L _ L I N E ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 6 ] . r u n ( 6 5 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r C a d e t B l u e ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   7 7   ( D r a w   L i n e )  
 c l a s s   B l o c k 6 6 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 7 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 1 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j N a m e   =   " T C H E C K L I N E " ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : T C H E C K _ L I N E ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 0 ] . r u n ( 6 6 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r C a d e t B l u e ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   7 8   ( F o r m u l a )  
 c l a s s   B l o c k 6 7 :   p u b l i c   M D L _ F o r m u l a _ 5 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ p o i n t s , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 8 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " - " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : T C H E C K ;  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 4 ] . r u n ( 6 7 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   7 9   ( M o d i f y   V a r i a b l e s )  
 c l a s s   B l o c k 6 8 :   p u b l i c   M D L _ M o d i f y V a r i a b l e s < i n t , M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T , d o u b l e , i n t , M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T , d o u b l e , i n t , M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 7 9 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 6 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 V a l u e 1 . N a m e   =   " T P L I N E " ;  
 	 	 V a l u e 2 . N a m e   =   " S L L I N E " ;  
 	 	 V a l u e 3 . N a m e   =   " T C H E C K L I N E " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ V a l u e 1 _ ( )   {  
 	 	 V a l u e 1 . P r o p e r t y   =   O B J P R O P _ P R I C E 1 ;  
  
 	 	 r e t u r n   V a l u e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 2 _ ( )   {  
 	 	 V a l u e 2 . P r o p e r t y   =   O B J P R O P _ P R I C E 1 ;  
  
 	 	 r e t u r n   V a l u e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 3 _ ( )   {  
 	 	 V a l u e 3 . P r o p e r t y   =   O B J P R O P _ P R I C E 1 ;  
  
 	 	 r e t u r n   V a l u e 3 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 4 _ ( )   { r e t u r n   V a l u e 4 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ V a l u e 5 _ ( )   { r e t u r n   V a l u e 5 . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 6 ] . r u n ( 6 8 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 v : : A T R _ T P _ L I N E _ T O _ T P   =   _ V a l u e 1 _ ( ) ;  
 	 	 v : : A T R _ S L _ L I N E _ T O _ S L   =   _ V a l u e 2 _ ( ) ;  
 	 	 v : : T C H E C K _ L I N E _ T O _ T C   =   _ V a l u e 3 _ ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   8 0   ( F o r m u l a )  
 c l a s s   B l o c k 6 9 :   p u b l i c   M D L _ F o r m u l a _ 6 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ p o i n t s , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 6 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   6 9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 0 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 0 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " - " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : S E L L _ T P ;  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 0 ] . r u n ( 6 9 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   8 1   ( F o r m u l a )  
 c l a s s   B l o c k 7 0 :   p u b l i c   M D L _ F o r m u l a _ 7 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ p o i n t s , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 1 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 1 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : S E L L _ S L ;  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 1 ] . r u n ( 7 0 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   8 2   ( F o r m u l a )  
 c l a s s   B l o c k 7 1 :   p u b l i c   M D L _ F o r m u l a _ 8 < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ p o i n t s , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 2 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 4 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : T C H E C K _ S E L L ;  
 	 	 R o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 4 ] . r u n ( 7 1 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   8 3   ( D r a w   L i n e )  
 c l a s s   B l o c k 7 2 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 3 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 1 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j N a m e   =   " S T P L I N E " ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : A T R _ S T P _ L I N E _ T O _ T P ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 1 2 ] . r u n ( 7 2 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r R e d ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   8 4   ( D r a w   L i n e )  
 c l a s s   B l o c k 7 3 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 4 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 2 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j N a m e   =   " S S L L I N E " ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : A T R _ S S L _ L I N E _ T O _ S L ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 2 ] . r u n ( 7 3 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r R e d ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   8 5   ( D r a w   L i n e )  
 c l a s s   B l o c k 7 4 :   p u b l i c   M D L _ C h a r t D r a w L i n e < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ v a l u e _ v a l u e , d o u b l e , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , d o u b l e , b o o l , b o o l , b o o l , c o l o r , E N U M _ L I N E _ S T Y L E , i n t , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 5 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 3 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j T i m e 2 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 2 . T i m e C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . C a n d l e I D   =   1 0 ;  
 	 	 O b j P r i c e 2 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j N a m e   =   " S T C H E C K L I N E " ;  
 	 	 O b j A n g l e   =   9 0 . 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . V a l u e   =   v : : T C H E C K _ S _ L I N E _ T O _ T C ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 2 _ ( )   { r e t u r n   O b j T i m e 2 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 2 _ ( )   {  
 	 	 O b j P r i c e 2 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 2 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 3 ] . r u n ( 7 4 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ H L I N E ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r R e d ;  
 	 	 O b j S t y l e   =   ( E N U M _ L I N E _ S T Y L E ) S T Y L E _ S O L I D ;  
 	 }  
 } ;  
  
 / /   B l o c k   8 6   ( M o d i f y   V a r i a b l e s )  
 c l a s s   B l o c k 7 5 :   p u b l i c   M D L _ M o d i f y V a r i a b l e s < i n t , M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T , d o u b l e , i n t , M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T , d o u b l e , i n t , M D L I C _ o b j e c t a t t r i b u t e s _ O B J E C T , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 6 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 7 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 V a l u e 1 . N a m e   =   " S T P L I N E " ;  
 	 	 V a l u e 2 . N a m e   =   " S S L L I N E " ;  
 	 	 V a l u e 3 . N a m e   =   " S T C H E C K L I N E " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ V a l u e 1 _ ( )   {  
 	 	 V a l u e 1 . P r o p e r t y   =   O B J P R O P _ P R I C E 1 ;  
  
 	 	 r e t u r n   V a l u e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 2 _ ( )   {  
 	 	 V a l u e 2 . P r o p e r t y   =   O B J P R O P _ P R I C E 1 ;  
  
 	 	 r e t u r n   V a l u e 2 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 3 _ ( )   {  
 	 	 V a l u e 3 . P r o p e r t y   =   O B J P R O P _ P R I C E 1 ;  
  
 	 	 r e t u r n   V a l u e 3 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ V a l u e 4 _ ( )   { r e t u r n   V a l u e 4 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ V a l u e 5 _ ( )   { r e t u r n   V a l u e 5 . _ e x e c u t e _ ( ) ; }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 7 ] . r u n ( 7 5 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 v : : A T R _ S T P _ L I N E _ T O _ T P   =   _ V a l u e 1 _ ( ) ;  
 	 	 v : : A T R _ S S L _ L I N E _ T O _ S L   =   _ V a l u e 2 _ ( ) ;  
 	 	 v : : T C H E C K _ S _ L I N E _ T O _ T C   =   _ V a l u e 3 _ ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   8 7   ( O n c e   p e r   b a r )  
 c l a s s   B l o c k 7 6 :   p u b l i c   M D L _ O n c e P e r B a r < s t r i n g , E N U M _ T I M E F R A M E S , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 6 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 6 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 7 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 5 , 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 ] . r u n ( 7 6 ) ;  
 	 	 	 _ b l o c k s _ [ 8 ] . r u n ( 7 6 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   8 8   ( O n c e   p e r   b a r )  
 c l a s s   B l o c k 7 7 :   p u b l i c   M D L _ O n c e P e r B a r < s t r i n g , E N U M _ T I M E F R A M E S , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 7 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 7 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 8 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 2 ]   =   { 6 , 7 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 ] . r u n ( 7 7 ) ;  
 	 	 	 _ b l o c k s _ [ 7 ] . r u n ( 7 7 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 S y m b o l   =   ( s t r i n g ) C u r r e n t S y m b o l ( ) ;  
 	 	 P e r i o d   =   ( E N U M _ T I M E F R A M E S ) C u r r e n t T i m e f r a m e ( ) ;  
 	 }  
 } ;  
  
 / /   B l o c k   8 9   ( D r a w   T e x t )  
 c l a s s   B l o c k 7 8 :   p u b l i c   M D L _ C h a r t D r a w T e x t < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , i n t , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , i n t , d o u b l e , E N U M _ B A S E _ C O R N E R , i n t , c o l o r , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 8 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 8 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 8 9 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 9 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j P r i c e 1 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j X   =   2 0 ;  
 	 	 O b j Y   =   2 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 1 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ O b j T e x t _ ( )   {  
 	 	 O b j T e x t . V a l u e   =   v : : A T R _ T O P ;  
  
 	 	 r e t u r n   O b j T e x t . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 9 ] . r u n ( 7 8 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ L A B E L ;  
 	 	 O b j C o r n e r   =   ( E N U M _ B A S E _ C O R N E R ) C O R N E R _ L E F T _ U P P E R ;  
 	 	 O b j A n c h o r   =   ( i n t ) A N C H O R _ L E F T _ U P P E R ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r S k y B l u e ;  
 	 }  
 } ;  
  
 / /   B l o c k   9 0   ( D r a w   T e x t )  
 c l a s s   B l o c k 7 9 :   p u b l i c   M D L _ C h a r t D r a w T e x t < b o o l , b o o l , s t r i n g , E N U M _ O B J E C T , M D L I C _ v a l u e _ t i m e , d a t e t i m e , M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , i n t , i n t , M D L I C _ v a l u e _ v a l u e , d o u b l e , s t r i n g , i n t , d o u b l e , E N U M _ B A S E _ C O R N E R , i n t , c o l o r , b o o l , b o o l , b o o l , b o o l , i n t , s t r i n g >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 7 9 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   7 9 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 0 " ;  
 	 	 _ b e f o r e E x e c u t e E n a b l e d   =   t r u e ;  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 5 9 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 O b j T i m e 1 . M o d e T i m e   =   3 ;  
 	 	 O b j T i m e 1 . T i m e C a n d l e I D   =   0 ;  
 	 	 O b j P r i c e 1 . T i m e S t a m p   =   " " ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 O b j e c t P e r B a r   =   f a l s e ;  
 	 	 O b j X   =   2 0 ;  
 	 	 O b j Y   =   4 0 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d a t e t i m e   _ O b j T i m e 1 _ ( )   { r e t u r n   O b j T i m e 1 . _ e x e c u t e _ ( ) ; }  
 	 v i r t u a l   d o u b l e   _ O b j P r i c e 1 _ ( )   {  
 	 	 O b j P r i c e 1 . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 O b j P r i c e 1 . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   O b j P r i c e 1 . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ O b j T e x t _ ( )   {  
 	 	 O b j T e x t . V a l u e   =   v : : A T R _ B O T T O M ;  
  
 	 	 r e t u r n   O b j T e x t . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 5 9 ] . r u n ( 7 9 ) ;  
 	 	 }  
 	 }  
  
 	 v i r t u a l   v o i d   _ b e f o r e E x e c u t e _ ( )  
 	 {  
  
 	 	 O b j e c t T y p e   =   ( E N U M _ O B J E C T ) O B J _ L A B E L ;  
 	 	 O b j C o r n e r   =   ( E N U M _ B A S E _ C O R N E R ) C O R N E R _ L E F T _ U P P E R ;  
 	 	 O b j A n c h o r   =   ( i n t ) A N C H O R _ L E F T _ U P P E R ;  
 	 	 O b j C o l o r   =   ( c o l o r ) c l r S k y B l u e ;  
 	 }  
 } ;  
  
 / /   B l o c k   9 1   ( C o n d i t i o n )  
 c l a s s   B l o c k 8 0 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 8 0 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   8 0 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 1 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 8 1 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " < " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ T O P ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 8 1 ] . r u n ( 8 0 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   9 2   ( C o n d i t i o n )  
 c l a s s   B l o c k 8 1 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 8 1 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   8 1 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 2 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 6 8 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ B O T T O M ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 6 8 ] . r u n ( 8 1 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   9 3   ( C o n d i t i o n )  
 c l a s s   B l o c k 8 2 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 8 2 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   8 2 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 3 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 8 3 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " < " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ T O P ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 8 3 ] . r u n ( 8 2 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   9 4   ( C o n d i t i o n )  
 c l a s s   B l o c k 8 3 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 8 3 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   8 3 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 4 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ B O T T O M ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 5 ] . r u n ( 8 3 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   9 5   ( C o n d i t i o n )  
 c l a s s   B l o c k 8 4 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 8 4 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   8 4 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 5 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 8 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 	 / /   B l o c k   i n p u t   p a r a m e t e r s  
 	 	 c o m p a r e   =   " < " ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ T O P ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 8 5 ] . r u n ( 8 4 ) ;  
 	 	 }  
 	 }  
 } ;  
  
 / /   B l o c k   9 6   ( C o n d i t i o n )  
 c l a s s   B l o c k 8 5 :   p u b l i c   M D L _ C o n d i t i o n < M D L I C _ c a n d l e s _ c a n d l e s , d o u b l e , s t r i n g , M D L I C _ v a l u e _ v a l u e , d o u b l e , i n t >  
 {  
  
 	 p u b l i c :   / *   C o n s t r u c t o r   * /  
 	 B l o c k 8 5 ( )   {  
 	 	 _ _ b l o c k _ n u m b e r   =   8 5 ;  
 	 	 _ _ b l o c k _ u s e r _ n u m b e r   =   " 9 6 " ;  
  
  
 	 	 / /   F i l l   t h e   l i s t   o f   o u t b o u n d   b l o c k s  
 	 	 i n t   _ _ _ o u t b o u n d _ b l o c k s [ 1 ]   =   { 7 5 } ;  
 	 	 A r r a y C o p y ( _ _ o u t b o u n d _ b l o c k s ,   _ _ _ o u t b o u n d _ b l o c k s ) ;  
  
 	 	 / /   I C   i n p u t   p a r a m e t e r s  
 	 	 L o . C a n d l e I D   =   1 ;  
 	 }  
  
 	 p u b l i c :   / *   C u s t o m   m e t h o d s   * /  
 	 v i r t u a l   d o u b l e   _ L o _ ( )   {  
 	 	 L o . S y m b o l   =   C u r r e n t S y m b o l ( ) ;  
 	 	 L o . P e r i o d   =   C u r r e n t T i m e f r a m e ( ) ;  
  
 	 	 r e t u r n   L o . _ e x e c u t e _ ( ) ;  
 	 }  
 	 v i r t u a l   d o u b l e   _ R o _ ( )   {  
 	 	 R o . V a l u e   =   v : : A T R _ B O T T O M ;  
  
 	 	 r e t u r n   R o . _ e x e c u t e _ ( ) ;  
 	 }  
  
 	 p u b l i c :   / *   C a l l b a c k   &   R u n   * /  
 	 v i r t u a l   v o i d   _ c a l l b a c k _ ( i n t   v a l u e )   {  
 	 	 i f   ( v a l u e   = =   1 )   {  
 	 	 	 _ b l o c k s _ [ 7 5 ] . r u n ( 8 5 ) ;  
 	 	 }  
 	 }  
 } ;  
  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / /   |                                                                                                       F u n c t i o n s                                                                                                             |   / /  
 / /   |                                                                   S y s t e m   a n d   C u s t o m   f u n c t i o n s   u s e d   i n   t h e   p r o g r a m                                                                     |   / /  
 / /   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +   / /  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
  
 d o u b l e   A c c o u n t B a l a n c e A t S t a r t ( ) 
 { 
 	 / /   T h i s   f u n c t i o n   M U S T   b e   r u n   o n c e   a t   p o g r a m ' s   s t a r t 
 	 s t a t i c   d o u b l e   m e m o r y   =   0 ; 
 
 	 i f   ( m e m o r y   = =   0 ) 
 	 { 
 	 	 m e m o r y   =   N o r m a l i z e D o u b l e ( A c c o u n t I n f o D o u b l e ( A C C O U N T _ B A L A N C E ) ,   2 ) ; 
 	 } 
 
 	 r e t u r n   m e m o r y ; 
 }  
  
 d o u b l e   A l i g n L o t s ( s t r i n g   s y m b o l ,   d o u b l e   l o t s ,   d o u b l e   l o w e r l o t s   =   0 . 0 ,   d o u b l e   u p p e r l o t s   =   0 . 0 ) 
 { 
 	 d o u b l e   L o t S t e p   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ S T E P ) ; 
 	 d o u b l e   L o t S i z e   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ T R A D E _ C O N T R A C T _ S I Z E ) ; 
 	 d o u b l e   M i n L o t s   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ M I N ) ; 
 	 d o u b l e   M a x L o t s   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ M A X ) ; 
 
 	 i f   ( L o t S t e p   >   M i n L o t s )   M i n L o t s   =   L o t S t e p ; 
 
 	 i f   ( l o t s   = =   E M P T Y _ V A L U E )   { l o t s   =   0 . 0 ; } 
 
 	 l o t s   =   M a t h R o u n d ( l o t s   /   L o t S t e p )   *   L o t S t e p ; 
 
 	 i f   ( l o t s   <   M i n L o t s )   { l o t s   =   M i n L o t s ; } 
 	 i f   ( l o t s   >   M a x L o t s )   { l o t s   =   M a x L o t s ; } 
 
 	 i f   ( l o w e r l o t s   >   0 . 0 ) 
 	 { 
 	 	 l o w e r l o t s   =   M a t h R o u n d ( l o w e r l o t s   /   L o t S t e p )   *   L o t S t e p ; 
 	 	 i f   ( l o t s   <   l o w e r l o t s )   { l o t s   =   l o w e r l o t s ; } 
 	 } 
 
 	 i f   ( u p p e r l o t s   >   0 . 0 ) 
 	 { 
 	 	 u p p e r l o t s   =   M a t h R o u n d ( u p p e r l o t s   /   L o t S t e p )   *   L o t S t e p ; 
 	 	 i f   ( l o t s   >   u p p e r l o t s )   { l o t s   =   u p p e r l o t s ; } 
 	 } 
 
 	 r e t u r n   l o t s ; 
 }  
  
 d o u b l e   A l i g n S t o p L o s s ( 
 	 s t r i n g   s y m b o l , 
 	 i n t   t y p e , 
 	 d o u b l e   p r i c e , 
 	 d o u b l e   s l o   =   0 . 0 ,   / /   o r i g i n a l   s l ,   u s e d   w h e n   m o d i f y i n g 
 	 d o u b l e   s l l   =   0 . 0 , 
 	 d o u b l e   s l p   =   0 . 0 , 
 	 b o o l   c o n s i d e r _ f r e e z e l e v e l   =   f a l s e 
 	 ) 
 { 
 	 d o u b l e   s l   =   0 . 0 ; 
 
 	 i f   ( M a t h A b s ( s l l )   = =   E M P T Y _ V A L U E )   { s l l   =   0 . 0 ; } 
 	 i f   ( M a t h A b s ( s l p )   = =   E M P T Y _ V A L U E )   { s l p   =   0 . 0 ; } 
 
 	 i f   ( s l l   = =   0 . 0   & &   s l p   = =   0 . 0 ) 
 	 { 
 	 	 r e t u r n   0 . 0 ; 
 	 } 
 
 	 i f   ( p r i c e   < =   0 . 0 ) 
 	 { 
 	 	 P r i n t ( _ _ F U N C T I O N _ _   +   "   e r r o r :   N o   p r i c e   e n t e r e d " ) ; 
 
 	 	 r e t u r n   - 1 ; 
 	 } 
 
 	 d o u b l e   p o i n t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ; 
 	 i n t   d i g i t s       =   ( i n t ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ D I G I T S ) ; 
 	 s l p                     =   s l p   *   P i p V a l u e ( s y m b o l )   *   p o i n t ; 
 
 	 / / - -   b u y - s e l l   i d e n t i f i e r   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 i n t   b s   =   1 ; 
 
 	 i f   ( 
 	 	       t y p e   = =   O P _ S E L L 
 	 	 | |   t y p e   = =   O P _ S E L L S T O P 
 	 	 | |   t y p e   = =   O P _ S E L L L I M I T 
 
 	 	 ) 
 	 { 
 	 	 b s   =   - 1 ; 
 	 } 
 
 	 / / - -   p r i c e s   t h a t   w i l l   b e   u s e d   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 d o u b l e   a s k b i d   =   p r i c e ; 
 	 d o u b l e   b i d a s k   =   p r i c e ; 
 	 
 	 i f   ( t y p e   <   2 ) 
 	 { 
 	 	 d o u b l e   a s k   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 	 	 d o u b l e   b i d   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ; 
 	 	 
 	 	 a s k b i d   =   a s k ; 
 	 	 b i d a s k   =   b i d ; 
 
 	 	 i f   ( b s   <   0 ) 
 	 	 { 
 	 	     a s k b i d   =   b i d ; 
 	 	     b i d a s k   =   a s k ; 
 	 	 } 
 	 } 
 
 	 / / - -   b u i l d   s l   l e v e l   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   
 	 i f   ( s l l   = =   0 . 0   & &   s l p   ! =   0 . 0 )   { s l l   =   p r i c e ; } 
 
 	 i f   ( s l l   >   0 . 0 )   { s l   =   s l l   -   s l p   *   b s ; } 
 
 	 i f   ( s l   <   0 . 0 ) 
 	 { 
 	 	 r e t u r n   - 1 ; 
 	 } 
 
 	 s l     =   N o r m a l i z e D o u b l e ( s l ,   d i g i t s ) ; 
 	 s l o   =   N o r m a l i z e D o u b l e ( s l o ,   d i g i t s ) ; 
 
 	 i f   ( s l   = =   s l o ) 
 	 { 
 	 	 r e t u r n   s l ; 
 	 } 
 
 	 / / - -   b u i l d   l i m i t   l e v e l s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 d o u b l e   m i n s t o p s   =   ( d o u b l e ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ T R A D E _ S T O P S _ L E V E L ) ; 
 
 	 i f   ( c o n s i d e r _ f r e e z e l e v e l   = =   t r u e ) 
 	 { 
 	 	 d o u b l e   f r e e z e l e v e l   =   ( d o u b l e ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ T R A D E _ F R E E Z E _ L E V E L ) ; 
 
 	 	 i f   ( f r e e z e l e v e l   >   m i n s t o p s )   { m i n s t o p s   =   f r e e z e l e v e l ; } 
 	 } 
 
 	 m i n s t o p s   =   N o r m a l i z e D o u b l e ( m i n s t o p s   *   p o i n t , d i g i t s ) ; 
 
 	 d o u b l e   s l l i m i t   =   b i d a s k   -   m i n s t o p s   *   b s ;   / /   S L   m i n   p r i c e   l e v e l 
 
 	 / / - -   c h e c k   a n d   a l i g n   s l ,   p r i n t   e r r o r s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 / / - -   d o   n o t   d o   i t   w h e n   t h e   s t o p   i s   t h e   s a m e   a s   t h e   o r i g i n a l 
 	 i f   ( s l   >   0 . 0   & &   s l   ! =   s l o ) 
 	 { 
 	 	 i f   ( ( b s   >   0   & &   s l   >   a s k b i d )   | |   ( b s   <   0   & &   s l   <   a s k b i d ) ) 
 	 	 { 
 	 	 	 s t r i n g   a b s t r   =   " " ; 
 
 	 	 	 i f   ( b s   >   0 )   { a b s t r   =   " B i d " ; }   e l s e   { a b s t r   =   " A s k " ; } 
 
 	 	 	 P r i n t ( 
 	 	 	 	 " E r r o r :   I n v a l i d   S L   r e q u e s t e d   ( " , 
 	 	 	 	 D o u b l e T o S t r ( s l ,   d i g i t s ) , 
 	 	 	 	 "   f o r   " ,   a b s t r ,   "   p r i c e   " , 
 	 	 	 	 b i d a s k , 
 	 	 	 	 " ) " 
 	 	 	 ) ; 
 
 	 	 	 r e t u r n   - 1 ; 
 	 	 } 
 	 	 e l s e   i f   ( ( b s   >   0   & &   s l   >   s l l i m i t )   | |   ( b s   <   0   & &   s l   <   s l l i m i t ) ) 
 	 	 { 
 	 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   s l ; 
 	 	 	 } 
 
 	 	 	 P r i n t ( 
 	 	 	 	 " W a r n i n g :   T o o   s h o r t   S L   r e q u e s t e d   ( " , 
 	 	 	 	 D o u b l e T o S t r ( s l ,   d i g i t s ) , 
 	 	 	 	 "   o r   " , 
 	 	 	 	 D o u b l e T o S t r ( M a t h A b s ( s l   -   a s k b i d )   /   p o i n t ,   0 ) , 
 	 	 	 	 "   p o i n t s ) ,   m i n i m u m   w i l l   b e   t a k e n   ( " , 
 	 	 	 	 D o u b l e T o S t r ( s l l i m i t ,   d i g i t s ) , 
 	 	 	 	 "   o r   " , 
 	 	 	 	 D o u b l e T o S t r ( M a t h A b s ( a s k b i d   -   s l l i m i t )   /   p o i n t ,   0 ) , 
 	 	 	 	 "   p o i n t s ) " 
 	 	 	 ) ; 
 
 	 	 	 s l   =   s l l i m i t ; 
 
 	 	 	 r e t u r n   s l ; 
 	 	 } 
 	 } 
 
 	 / /   a l i g n   b y   t h e   t i c k s i z e 
 	 d o u b l e   t i c k s i z e   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ T R A D E _ T I C K _ S I Z E ) ; 
 	 s l   =   M a t h R o u n d ( s l   /   t i c k s i z e )   *   t i c k s i z e ; 
 
 	 r e t u r n   s l ; 
 }  
  
 d o u b l e   A l i g n T a k e P r o f i t ( 
 	 s t r i n g   s y m b o l , 
 	 i n t   t y p e , 
 	 d o u b l e   p r i c e , 
 	 d o u b l e   t p o   =   0 . 0 ,   / /   o r i g i n a l   t p ,   u s e d   w h e n   m o d i f y i n g 
 	 d o u b l e   t p l   =   0 . 0 , 
 	 d o u b l e   t p p   =   0 . 0 , 
 	 b o o l   c o n s i d e r _ f r e e z e l e v e l   =   f a l s e 
 	 ) 
 { 
 	 d o u b l e   t p   =   0 . 0 ; 
 	 
 	 i f   ( M a t h A b s ( t p l )   = =   E M P T Y _ V A L U E )   { t p l   =   0 . 0 ; } 
 	 i f   ( M a t h A b s ( t p p )   = =   E M P T Y _ V A L U E )   { t p p   =   0 . 0 ; } 
 
 	 i f   ( t p l   = =   0 . 0   & &   t p p   = =   0 . 0 ) 
 	 { 
 	 	 r e t u r n   0 . 0 ; 
 	 } 
 
 	 i f   ( p r i c e   < =   0 . 0 ) 
 	 { 
 	 	 P r i n t ( _ _ F U N C T I O N _ _   +   "   e r r o r :   N o   p r i c e   e n t e r e d " ) ; 
 
 	 	 r e t u r n   - 1 ; 
 	 } 
 
 	 d o u b l e   p o i n t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ; 
 	 i n t   d i g i t s       =   ( i n t ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ D I G I T S ) ; 
 	 t p p                     =   t p p   *   P i p V a l u e ( s y m b o l )   *   p o i n t ; 
 	 
 	 / / - -   b u y - s e l l   i d e n t i f i e r   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 i n t   b s   =   1 ; 
 
 	 i f   ( 
 	 	       t y p e   = =   O P _ S E L L 
 	 	 | |   t y p e   = =   O P _ S E L L S T O P 
 	 	 | |   t y p e   = =   O P _ S E L L L I M I T 
 
 	 	 ) 
 	 { 
 	 	 b s   =   - 1 ; 
 	 } 
 	 
 	 / / - -   p r i c e s   t h a t   w i l l   b e   u s e d   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 d o u b l e   a s k b i d   =   p r i c e ; 
 	 d o u b l e   b i d a s k   =   p r i c e ; 
 	 
 	 i f   ( t y p e   <   2 ) 
 	 { 
 	 	 d o u b l e   a s k   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 	 	 d o u b l e   b i d   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ; 
 	 	 
 	 	 a s k b i d   =   a s k ; 
 	 	 b i d a s k   =   b i d ; 
 
 	 	 i f   ( b s   <   0 ) 
 	 	 { 
 	 	     a s k b i d   =   b i d ; 
 	 	     b i d a s k   =   a s k ; 
 	 	 } 
 	 } 
 	 
 	 / / - -   b u i l d   t p   l e v e l   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   
 	 i f   ( t p l   = =   0 . 0   & &   t p p   ! =   0 . 0 )   { t p l   =   p r i c e ; } 
 
 	 i f   ( t p l   >   0 . 0 )   { t p   =   t p l   +   t p p   *   b s ; } 
 	 
 	 i f   ( t p   <   0 . 0 ) 
 	 { 
 	 	 r e t u r n   - 1 ; 
 	 } 
 
 	 t p     =   N o r m a l i z e D o u b l e ( t p ,   d i g i t s ) ; 
 	 t p o   =   N o r m a l i z e D o u b l e ( t p o ,   d i g i t s ) ; 
 
 	 i f   ( t p   = =   t p o ) 
 	 { 
 	 	 r e t u r n   t p ; 
 	 } 
 	 
 	 / / - -   b u i l d   l i m i t   l e v e l s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 d o u b l e   m i n s t o p s   =   ( d o u b l e ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ T R A D E _ S T O P S _ L E V E L ) ; 
 
 	 i f   ( c o n s i d e r _ f r e e z e l e v e l   = =   t r u e ) 
 	 { 
 	 	 d o u b l e   f r e e z e l e v e l   =   ( d o u b l e ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ T R A D E _ F R E E Z E _ L E V E L ) ; 
 
 	 	 i f   ( f r e e z e l e v e l   >   m i n s t o p s )   { m i n s t o p s   =   f r e e z e l e v e l ; } 
 	 } 
 
 	 m i n s t o p s   =   N o r m a l i z e D o u b l e ( m i n s t o p s   *   p o i n t , d i g i t s ) ; 
 	 
 	 d o u b l e   t p l i m i t   =   b i d a s k   +   m i n s t o p s   *   b s ;   / /   T P   m i n   p r i c e   l e v e l 
 	 
 	 / / - -   c h e c k   a n d   a l i g n   t p ,   p r i n t   e r r o r s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 / / - -   d o   n o t   d o   i t   w h e n   t h e   s t o p   i s   t h e   s a m e   a s   t h e   o r i g i n a l 
 	 i f   ( t p   >   0 . 0   & &   t p   ! =   t p o ) 
 	 { 
 	 	 i f   ( ( b s   >   0   & &   t p   <   b i d a s k )   | |   ( b s   <   0   & &   t p   >   b i d a s k ) ) 
 	 	 { 
 	 	 	 s t r i n g   a b s t r   =   " " ; 
 
 	 	 	 i f   ( b s   >   0 )   { a b s t r   =   " B i d " ; }   e l s e   { a b s t r   =   " A s k " ; } 
 
 	 	 	 P r i n t ( 
 	 	 	 	 " E r r o r :   I n v a l i d   T P   r e q u e s t e d   ( " , 
 	 	 	 	 D o u b l e T o S t r ( t p ,   d i g i t s ) , 
 	 	 	 	 "   f o r   " ,   a b s t r ,   "   p r i c e   " , 
 	 	 	 	 b i d a s k , 
 	 	 	 	 " ) " 
 	 	 	 ) ; 
 
 	 	 	 r e t u r n   - 1 ; 
 	 	 } 
 	 	 e l s e   i f   ( ( b s   >   0   & &   t p   <   t p l i m i t )   | |   ( b s   <   0   & &   t p   >   t p l i m i t ) ) 
 	 	 { 
 	 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   t p ; 
 	 	 	 } 
 
 	 	 	 P r i n t ( 
 	 	 	 	 " W a r n i n g :   T o o   s h o r t   T P   r e q u e s t e d   ( " , 
 	 	 	 	 D o u b l e T o S t r ( t p ,   d i g i t s ) , 
 	 	 	 	 "   o r   " , 
 	 	 	 	 D o u b l e T o S t r ( M a t h A b s ( t p   -   a s k b i d )   /   p o i n t ,   0 ) , 
 	 	 	 	 "   p o i n t s ) ,   m i n i m u m   w i l l   b e   t a k e n   ( " , 
 	 	 	 	 D o u b l e T o S t r ( t p l i m i t ,   d i g i t s ) , 
 	 	 	 	 "   o r   " , 
 	 	 	 	 D o u b l e T o S t r ( M a t h A b s ( a s k b i d   -   t p l i m i t )   /   p o i n t ,   0 ) , 
 	 	 	 	 "   p o i n t s ) " 
 	 	 	 ) ; 
 
 	 	 	 t p   =   t p l i m i t ; 
 
 	 	 	 r e t u r n   t p ; 
 	 	 } 
 	 } 
 	 
 	 / /   a l i g n   b y   t h e   t i c k s i z e 
 	 d o u b l e   t i c k s i z e   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ T R A D E _ T I C K _ S I Z E ) ; 
 	 t p   =   M a t h R o u n d ( t p   /   t i c k s i z e )   *   t i c k s i z e ; 
 	 
 	 r e t u r n   t p ; 
 }  
  
 t e m p l a t e < t y p e n a m e   T > 
 b o o l   A r r a y E n s u r e V a l u e ( T   & a r r a y [ ] ,   T   v a l u e ) 
 { 
 	 i n t   s i z e       =   A r r a y S i z e ( a r r a y ) ; 
 	 
 	 i f   ( s i z e   >   0 ) 
 	 { 
 	 	 i f   ( I n A r r a y ( a r r a y ,   v a l u e ) ) 
 	 	 { 
 	 	 	 / /   v a l u e   f o u n d   - >   e x i t 
 	 	 	 r e t u r n   f a l s e ;   / /   n o   v a l u e   a d d e d 
 	 	 } 
 	 } 
 	 
 	 / /   v a l u e   d o e s   n o t   e x i s t s   - >   a d d   i t 
 	 A r r a y R e s i z e ( a r r a y ,   s i z e + 1 ) ; 
 	 a r r a y [ s i z e ]   =   v a l u e ; 
 	 	 
 	 r e t u r n   t r u e ;   / /   v a l u e   a d d e d 
 }  
  
 t e m p l a t e < t y p e n a m e   T > 
 i n t   A r r a y S e a r c h ( T   & a r r a y [ ] ,   T   v a l u e ) 
 { 
 	 i n t   i n d e x   =   - 1 ; 
 	 i n t   s i z e     =   A r r a y S i z e ( a r r a y ) ; 
 
 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 { 
 	 	 i f   ( a r r a y [ i ]   = =   v a l u e ) 
 	 	 { 
 	 	 	 i n d e x   =   i ; 
 	 	 	 b r e a k ; 
 	 	 }     
 	 } 
 
       r e t u r n   i n d e x ; 
 }  
  
 t e m p l a t e < t y p e n a m e   T > 
 b o o l   A r r a y S t r i p K e y ( T   & a r r a y [ ] ,   i n t   k e y ) 
 { 
 	 i n t   x         =   0 ; 
 	 i n t   s i z e   =   A r r a y S i z e ( a r r a y ) ; 
 
 	 f o r   ( i n t   i = 0 ;   i < s i z e ;   i + + ) 
 	 { 
 	 	 i f   ( i   ! =   k e y ) 
 	 	 { 
 	 	 	 a r r a y [ x ]   =   a r r a y [ i ] ; 
 	 	 	 x + + ; 
 	 	 } 
 	 } 
 
 	 i f   ( x   <   s i z e ) 
 	 { 
 	 	 A r r a y R e s i z e ( a r r a y ,   x ) ; 
 	 	 
 	 	 r e t u r n   t r u e ;   / /   s t r i p p e d 
 	 } 
 
 	 r e t u r n   f a l s e ;   / /   n o t   s t r i p p e d 
 }  
  
 t e m p l a t e < t y p e n a m e   T > 
 b o o l   A r r a y S t r i p V a l u e ( T   & a r r a y [ ] ,   T   v a l u e ) 
 { 
 	 i n t   x         =   0 ; 
 	 i n t   s i z e   =   A r r a y S i z e ( a r r a y ) ; 
 
 	 f o r   ( i n t   i = 0 ;   i < s i z e ;   i + + ) 
 	 { 
 	 	 i f   ( a r r a y [ i ]   ! =   v a l u e ) 
 	 	 { 
 	 	 	 a r r a y [ x ]   =   a r r a y [ i ] ; 
 	 	 	 x + + ; 
 	 	 } 
 	 } 
 
 	 i f   ( x   <   s i z e ) 
 	 { 
 	 	 A r r a y R e s i z e ( a r r a y ,   x ) ; 
 	 	 
 	 	 r e t u r n   t r u e ;   / /   s t r i p p e d 
 	 } 
 
 	 r e t u r n   f a l s e ;   / /   n o t   s t r i p p e d 
 }  
  
 d o u b l e   B e t 1 3 2 6 ( 
 	 s t r i n g   g r o u p , 
 	 s t r i n g   s y m b o l , 
 	 i n t   p o o l , 
 	 d o u b l e   i n i t i a l L o t s , 
 	 b o o l   r e v e r s e   =   f a l s e 
 )   {     
 	 d o u b l e   i n f o [ ] ; 
 	 G e t B e t T r a d e s I n f o ( i n f o ,   g r o u p ,   s y m b o l ,   p o o l ,   f a l s e ) ; 
 
 	 d o u b l e   l o t s                   =   i n f o [ 0 ] ; 
 	 d o u b l e   p r o f i t O r L o s s   =   i n f o [ 1 ] ;   / /   0   -   u n k n o w n ,   1   -   p r o f i t ,   - 1   -   l o s s 
 
 	 / / - -   1 - 3 - 2 - 6   L o g i c 
 	 d o u b l e   m i n L o t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ M I N ) ; 
 
 	 i f   ( i n i t i a l L o t s   <   m i n L o t ) 
 	 { 
 	 	 i n i t i a l L o t s   =   m i n L o t ;     
 	 } 
 
 	 i f   ( l o t s   = =   0 ) 
 	 { 
 	 	 l o t s   =   i n i t i a l L o t s ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( 
 	 	 	       ( r e v e r s e   = =   f a l s e   & &   p r o f i t O r L o s s   = =   1 ) 
 	 	 	 | |   ( r e v e r s e   = =   t r u e   & &   p r o f i t O r L o s s   = =   - 1 ) 
 	 	 )   { 
 	 	 	 d o u b l e   d i v   =   l o t s   /   i n i t i a l L o t s ; 
 
 	 	 	           i f   ( d i v   <   1 . 5 )   { l o t s   =   i n i t i a l L o t s   *   3 ; } 
 	 	 	 e l s e   i f   ( d i v   <   2 . 5 )   { l o t s   =   i n i t i a l L o t s   *   6 ; } 
 	 	 	 e l s e   i f   ( d i v   <   3 . 5 )   { l o t s   =   i n i t i a l L o t s   *   2 ; } 
 	 	 	 e l s e   { l o t s   =   i n i t i a l L o t s ; } 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 l o t s   =   i n i t i a l L o t s ; 
 	 	 } 
 	 } 
 
 	 r e t u r n   l o t s ; 
 }  
  
 d o u b l e   B e t D a l e m b e r t ( 
 	 s t r i n g   g r o u p , 
 	 s t r i n g   s y m b o l , 
 	 i n t   p o o l , 
 	 d o u b l e   i n i t i a l L o t s , 
 	 d o u b l e   r e v e r s e   =   f a l s e 
 )   {     
 	 d o u b l e   i n f o [ ] ; 
 	 G e t B e t T r a d e s I n f o ( i n f o ,   g r o u p ,   s y m b o l ,   p o o l ,   f a l s e ) ; 
 
 	 d o u b l e   l o t s                   =   i n f o [ 0 ] ; 
 	 d o u b l e   p r o f i t O r L o s s   =   i n f o [ 1 ] ;   / /   0   -   u n k n o w n ,   1   -   p r o f i t ,   - 1   -   l o s s 
 
 	 / / - -   D a l e m b e r t   L o g i c 
 	 d o u b l e   m i n L o t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ M I N ) ; 
 
 	 i f   ( i n i t i a l L o t s   <   m i n L o t ) 
 	 { 
 	 	 i n i t i a l L o t s   =   m i n L o t ;     
 	 } 
 
 	 i f   ( l o t s   = =   0 ) 
 	 { 
 	 	 l o t s   =   i n i t i a l L o t s ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( 
 	 	 	       ( r e v e r s e   = =   0   & &   p r o f i t O r L o s s   = =   1 ) 
 	 	 	 | |   ( r e v e r s e   = =   1   & &   p r o f i t O r L o s s   = =   - 1 ) 
 	 	 )   { 
 	 	 	 l o t s   =   l o t s   -   i n i t i a l L o t s ; 
 	 	 	 i f   ( l o t s   <   i n i t i a l L o t s )   { l o t s   =   i n i t i a l L o t s ; } 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 l o t s   =   l o t s   +   i n i t i a l L o t s ; 
 	 	 } 
 	 } 
 
 	 r e t u r n   l o t s ; 
 }  
  
 d o u b l e   B e t F i b o n a c c i ( 
 	 s t r i n g   g r o u p , 
 	 s t r i n g   s y m b o l , 
 	 i n t   p o o l , 
 	 d o u b l e   i n i t i a l L o t s 
 )   { 
 	 d o u b l e   i n f o [ ] ; 
 	 G e t B e t T r a d e s I n f o ( i n f o ,   g r o u p ,   s y m b o l ,   p o o l ,   f a l s e ) ; 
 
 	 d o u b l e   l o t s                   =   i n f o [ 0 ] ; 
 	 d o u b l e   p r o f i t O r L o s s   =   i n f o [ 1 ] ;   / /   0   -   u n k n o w n ,   1   -   p r o f i t ,   - 1   -   l o s s 
 
 	 / / - -   F i b o n a c c i   L o g i c 
 	 d o u b l e   m i n L o t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ M I N ) ; 
 
 	 i f   ( i n i t i a l L o t s   <   m i n L o t ) 
 	 { 
 	 	 i n i t i a l L o t s   =   m i n L o t ;     
 	 } 
 
 	 i f   ( l o t s   = =   0 ) 
 	 { 
 	 	 l o t s   =   i n i t i a l L o t s ; 
 	 } 
 	 e l s e 
 	 {     
 	 	 i n t   f i b o 1   =   1 ; 
 	 	 i n t   f i b o 2   =   0 ; 
 	 	 i n t   f i b o 3   =   0 ; 
 	 	 i n t   f i b o 4   =   0 ; 
 	 	 d o u b l e   d i v   =   l o t s   /   i n i t i a l L o t s ; 
 
 	 	 i f   ( d i v   < =   0 )   { d i v   =   1 ; } 
 
 	 	 w h i l e   ( t r u e ) 
 	 	 { 
 	 	 	 f i b o 1   =   f i b o 1   +   f i b o 2 ; 
 	 	 	 f i b o 3   =   f i b o 2 ; 
 	 	 	 f i b o 2   =   f i b o 1   -   f i b o 2 ; 
 	 	 	 f i b o 4   =   f i b o 2   -   f i b o 3 ; 
 
 	 	 	 i f   ( f i b o 1   >   N o r m a l i z e D o u b l e ( d i v ,   2 ) ) 
 	 	 	 { 
 	 	 	 	 b r e a k ; 
 	 	 	 } 
 	 	 } 
 
 	 	 i f   ( p r o f i t O r L o s s   = =   1 ) 
 	 	 { 
 	 	 	 i f   ( f i b o 4   < =   0 )   { f i b o 4   =   1 ; } 
 	 	 	 l o t s   =   i n i t i a l L o t s   *   f i b o 4 ; 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 l o t s   =   i n i t i a l L o t s   *   f i b o 1 ; 
 	 	 } 
 	 } 
 
 	 l o t s   =   N o r m a l i z e D o u b l e ( l o t s ,   2 ) ; 
 
 	 r e t u r n   l o t s ; 
 }  
  
 d o u b l e   B e t L a b o u c h e r e ( 
 	 s t r i n g   g r o u p , 
 	 s t r i n g   s y m b o l , 
 	 i n t   p o o l , 
 	 d o u b l e   i n i t i a l L o t s , 
 	 s t r i n g   l i s t O f N u m b e r s , 
 	 d o u b l e   r e v e r s e   =   f a l s e 
 )   { 
 	 d o u b l e   i n f o [ ] ; 
 	 G e t B e t T r a d e s I n f o ( i n f o ,   g r o u p ,   s y m b o l ,   p o o l ,   f a l s e ) ; 
 
 	 d o u b l e   l o t s                   =   i n f o [ 0 ] ; 
 	 d o u b l e   p r o f i t O r L o s s   =   i n f o [ 1 ] ;   / /   0   -   u n k n o w n ,   1   -   p r o f i t ,   - 1   -   l o s s 
 
 	 / / - -   L a b o u c h e r e   L o g i c 
 	 s t a t i c   s t r i n g   m e m G r o u p [ ] ; 
 	 s t a t i c   s t r i n g   m e m L i s t [ ] ; 
 	 s t a t i c   l o n g   m e m T i c k e t [ ] ; 
 
 	 i n t   s t a r t A g a i n   =   f a l s e ; 
 
 	 / / -   g e t   t h e   l i s t   o f   n u m b e r s   a s   i t   i s   s t o r e d   i n   t h e   m e m o r y ,   o r   s t o r e   i t 
 	 i n t   i d   =   A r r a y S e a r c h ( m e m G r o u p ,   g r o u p ) ; 
 
 	 i f   ( i d   = =   - 1 ) 
 	 { 
 	 	 s t a r t A g a i n   =   t r u e ; 
 
 	 	 i f   ( l i s t O f N u m b e r s   = =   " " )   { l i s t O f N u m b e r s   =   " 1 " ; } 
 
 	 	 i d   =   A r r a y S i z e ( m e m G r o u p ) ; 
 
 	 	 A r r a y R e s i z e ( m e m G r o u p ,   i d + 1 ,   i d + 1 ) ; 
 	 	 A r r a y R e s i z e ( m e m L i s t ,   i d + 1 ,   i d + 1 ) ; 
 	 	 A r r a y R e s i z e ( m e m T i c k e t ,   i d + 1 ,   i d + 1 ) ; 
 
 	 	 m e m G r o u p [ i d ]   =   g r o u p ; 
 	 	 m e m L i s t [ i d ]     =   l i s t O f N u m b e r s ; 
 	 } 
 
 	 i f   ( m e m T i c k e t [ i d ]   = =   ( l o n g ) O r d e r T i c k e t ( ) ) 
 	 { 
 	 	 / /   t h e   l a s t   k n o w n   t i c k e t   ( m e m T i c k e t [ i d ] )   s h o u l d   b e   d i f f e r e n t   t h a n   O d e r T i c k e t ( )   n o r m a l l y 
 	 	 / /   w h e n   f a i l e d   t o   c r e a t e   a   n e w   t r a d e   -   t h e   l a s t   t i c k e t   r e m a i n s   t h e   s a m e 
 	 	 / /   s o   w e   n e e d   t o   r e s e t 
 	 	 m e m L i s t [ i d ]   =   l i s t O f N u m b e r s ; 
 	 } 
 
 	 m e m T i c k e t [ i d ]   =   ( l o n g ) O r d e r T i c k e t ( ) ; 
 
 	 / / -   n o w   t u r n   t h e   s t r i n g   i n t o   i n t e g e r   a r r a y 
 	 i n t   l i s t [ ] ; 
 	 s t r i n g   l i s t S [ ] ; 
 
 	 S t r i n g E x p l o d e ( " , " ,   m e m L i s t [ i d ] ,   l i s t S ) ; 
 	 A r r a y R e s i z e ( l i s t ,   A r r a y S i z e ( l i s t S ) ) ; 
 
 	 f o r   ( i n t   s   =   0 ;   s   <   A r r a y S i z e ( l i s t S ) ;   s + + ) 
 	 { 
 	 	 l i s t [ s ]   =   ( i n t ) S t r i n g T o I n t e g e r ( S t r i n g T r i m ( l i s t S [ s ] ) ) ;     
 	 } 
 
 	 / / - -   
 	 i n t   s i z e   =   A r r a y S i z e ( l i s t ) ; 
 
 	 d o u b l e   m i n L o t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ M I N ) ; 
 
 	 i f   ( i n i t i a l L o t s   <   m i n L o t ) 
 	 { 
 	 	 i n i t i a l L o t s   =   m i n L o t ;     
 	 } 
 
 	 i f   ( l o t s   = =   0 ) 
 	 { 
 	 	 s t a r t A g a i n   =   t r u e ; 
 	 } 
 
 	 i f   ( s t a r t A g a i n   = =   t r u e ) 
 	 { 
 	 	 i f   ( s i z e   = =   1 ) 
 	 	 { 
 	 	 	 l o t s   =   i n i t i a l L o t s   *   l i s t [ 0 ] ; 
 	 	 } 
 	 	 e l s e   { 
 	 	 	 l o t s   =   i n i t i a l L o t s   *   ( l i s t [ 0 ]   +   l i s t [ s i z e - 1 ] ) ; 
 	 	 } 
 	 } 
 	 e l s e   
 	 { 
 	 	 i f   ( 
 	 	 	       ( r e v e r s e   = =   0   & &   p r o f i t O r L o s s   = =   1 ) 
 	 	 	 | |   ( r e v e r s e   = =   1   & &   p r o f i t O r L o s s   = =   - 1 ) 
 	 	 )   { 
 	 	 	 i f   ( s i z e   = =   1 ) 
 	 	 	 { 
 	 	 	 	 l o t s   =   i n i t i a l L o t s   *   l i s t [ 0 ] ; 
 	 	 	 	 A r r a y R e s i z e ( l i s t ,   0 ) ; 
 	 	 	 } 
 	 	 	 e l s e   i f   ( s i z e   = =   2 ) 
 	 	 	 { 
 	 	 	 	 l o t s   =   i n i t i a l L o t s   *   ( l i s t [ 0 ]   +   l i s t [ 1 ] ) ; 
 	 	 	 	 A r r a y R e s i z e ( l i s t ,   0 ) ; 
 	 	 	 } 
 	 	 	 e l s e   i f   ( s i z e   >   2 ) 
 	 	 	 { 
 	 	 	 	 l o t s   =   i n i t i a l L o t s   *   ( l i s t [ 0 ]   +   l i s t [ s i z e - 1 ] ) ; 
 
 	 	 	 	 / /   C a n c e l   t h e   f i r s t   a n d   t h e   l a s t   n u m b e r   i n   t h e   l i s t 
 	 	 	 	 / /   s h i f t   a r r a y   1   s t e p   l e f t 
 	 	 	 	 f o r ( i n t   p o s   =   0 ;   p o s   <   s i z e - 1 ;   p o s + + ) 
 	 	 	 	 { 
 	 	 	 	 	 l i s t [ p o s ]   =   l i s t [ p o s + 1 ] ; 
 	 	 	 	 } 
 
 	 	 	 	 / /   r e m o v e   l a s t   2   e l e m e n t s 	 
 	 	 	 	 A r r a y R e s i z e ( l i s t ,   A r r a y S i z e ( l i s t )   -   2 ) ; 	 
 	 	 	 } 
 
 	 	 	 i f   ( l o t s   <   i n i t i a l L o t s )   { l o t s   =   i n i t i a l L o t s ; } 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 i f   ( s i z e   >   1 ) 
 	 	 	 { 
 	 	 	 	 A r r a y R e s i z e ( l i s t ,   s i z e + 1 ) ; 
 
 	 	 	 	 l i s t [ s i z e ]   =   l i s t [ 0 ]   +   l i s t [ s i z e - 1 ] ; 
 	 	 	 	 l o t s               =   i n i t i a l L o t s   *   ( l i s t [ 0 ]   +   l i s t [ s i z e ] ) ; 
 	 	 	 } 
 	 	 	 e l s e   { 
 	 	 	 	 l o t s   =   i n i t i a l L o t s   *   l i s t [ 0 ] ; 
 	 	 	 } 
 
 	 	 	 i f   ( l o t s   <   i n i t i a l L o t s )   { l o t s   =   i n i t i a l L o t s ; } 
 	 	 } 
 	 } 
 
 	 P r i n t ( " L a b o u c h e r e   ( f o r   g r o u p   " 
 	 	 +   ( s t r i n g ) i d 
 	 	 +   " )   c u r r e n t   l i s t   o f   n u m b e r s : " 
 	 	 +   S t r i n g I m p l o d e ( " , " ,   l i s t ) 
 	 ) ; 
 
 	 s i z e = A r r a y S i z e ( l i s t ) ; 
 
 	 i f   ( s i z e   = =   0 ) 
 	 { 
 	 	 A r r a y S t r i p K e y ( m e m G r o u p ,   i d ) ; 
 	 	 A r r a y S t r i p K e y ( m e m L i s t ,   i d ) ; 
 	 	 A r r a y S t r i p K e y ( m e m T i c k e t ,   i d ) ; 
 	 } 
 	 e l s e   { 
 	 	 m e m L i s t [ i d ]   =   S t r i n g I m p l o d e ( " , " ,   l i s t ) ; 
 	 } 
 
 	 r e t u r n   l o t s ; 
 }  
  
 d o u b l e   B e t M a r t i n g a l e ( 
 	 s t r i n g   g r o u p , 
 	 s t r i n g   s y m b o l , 
 	 i n t   p o o l , 
 	 d o u b l e   i n i t i a l L o t s , 
 	 d o u b l e   m u l t i p l y O n L o s s , 
 	 d o u b l e   m u l t i p l y O n P r o f i t , 
 	 d o u b l e   a d d O n L o s s , 
 	 d o u b l e   a d d O n P r o f i t , 
 	 i n t   r e s e t O n L o s s , 
 	 i n t   r e s e t O n P r o f i t 
 )   { 
 	 d o u b l e   i n f o [ ] ; 
 	 G e t B e t T r a d e s I n f o ( i n f o ,   g r o u p ,   s y m b o l ,   p o o l ,   t r u e ) ; 
 
 	 d o u b l e   l o t s                   =   i n f o [ 0 ] ; 
 	 d o u b l e   p r o f i t O r L o s s   =   i n f o [ 1 ] ;   / /   0   -   u n k n o w n ,   1   -   p r o f i t ,   - 1   -   l o s s 
 	 d o u b l e   c o n s e c u t i v e     =   i n f o [ 2 ] ; 
 
 	 / / - -   M a r t i n g a l e   L o g i c 
 	 i f   ( l o t s   = =   0 ) 
 	 { 
 	 	 l o t s   =   i n i t i a l L o t s ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( p r o f i t O r L o s s   = =   1 ) 
 	 	 { 
 	 	 	 i f   ( r e s e t O n P r o f i t   >   0   & &   c o n s e c u t i v e   > =   r e s e t O n P r o f i t ) 
 	 	 	 { 
 	 	 	 	 l o t s   =   i n i t i a l L o t s ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 i f   ( m u l t i p l y O n P r o f i t   < =   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 m u l t i p l y O n P r o f i t   =   1 ; 
 	 	 	 	 } 
 
 	 	 	 	 l o t s   =   ( l o t s   *   m u l t i p l y O n P r o f i t )   +   a d d O n P r o f i t ; 
 	 	 	 } 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 i f   ( r e s e t O n L o s s   >   0   & &   c o n s e c u t i v e   > =   r e s e t O n L o s s ) 
 	 	 	 { 
 	 	 	 	 l o t s   =   i n i t i a l L o t s ;     
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 i f   ( m u l t i p l y O n L o s s   < =   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 m u l t i p l y O n L o s s   =   1 ; 
 	 	 	 	 } 
 
 	 	 	 	 l o t s   =   ( l o t s   *   m u l t i p l y O n L o s s )   +   a d d O n L o s s ; 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 r e t u r n   l o t s ; 
 }  
  
 d o u b l e   B e t S e q u e n c e ( 
 	 s t r i n g   g r o u p , 
 	 s t r i n g   s y m b o l , 
 	 i n t   p o o l , 
 	 d o u b l e   i n i t i a l L o t s , 
 	 s t r i n g   s e q u e n c e O n L o s s , 
 	 s t r i n g   s e q u e n c e O n P r o f i t , 
 	 b o o l   r e v e r s e   =   f a l s e 
 )   {     
 	 d o u b l e   i n f o [ ] ; 
 	 G e t B e t T r a d e s I n f o ( i n f o ,   g r o u p ,   s y m b o l ,   p o o l ,   f a l s e ) ; 
 
 	 d o u b l e   l o t s                   =   i n f o [ 0 ] ; 
 	 d o u b l e   p r o f i t O r L o s s   =   i n f o [ 1 ] ;   / /   0   -   u n k n o w n ,   1   -   p r o f i t ,   - 1   -   l o s s 
 
 	 / / - -   S e q u e n c e   s t u f f 
 	 s t a t i c   s t r i n g   m e m G r o u p [ ] ; 
 	 s t a t i c   s t r i n g   m e m L o s s L i s t [ ] ; 
 	 s t a t i c   s t r i n g   m e m P r o f i t L i s t [ ] ; 
 	 s t a t i c   l o n g   m e m T i c k e t [ ] ; 
 
 	 / / -   g e t   t h e   l i s t   o f   n u m b e r s   a s   i t   i s   s t o r e d   i n   t h e   m e m o r y ,   o r   s t o r e   i t 
 	 i n t   i d   =   A r r a y S e a r c h ( m e m G r o u p ,   g r o u p ) ; 
 
 	 i f   ( i d   = =   - 1 ) 
 	 { 
 	 	 i f   ( s e q u e n c e O n L o s s   = =   " " )   { s e q u e n c e O n L o s s   =   " 1 " ; } 
 
 	 	 i f   ( s e q u e n c e O n P r o f i t   = =   " " )   { s e q u e n c e O n P r o f i t   =   " 1 " ; } 
 
 	 	 i d   =   A r r a y S i z e ( m e m G r o u p ) ; 
 
 	 	 A r r a y R e s i z e ( m e m G r o u p ,   i d + 1 ,   i d + 1 ) ; 
 	 	 A r r a y R e s i z e ( m e m L o s s L i s t ,   i d + 1 ,   i d + 1 ) ; 
 	 	 A r r a y R e s i z e ( m e m P r o f i t L i s t ,   i d + 1 ,   i d + 1 ) ; 
 	 	 A r r a y R e s i z e ( m e m T i c k e t ,   i d + 1 ,   i d + 1 ) ; 
 
 	 	 m e m G r o u p [ i d ]             =   g r o u p ; 
 	 	 m e m L o s s L i s t [ i d ]       =   s e q u e n c e O n L o s s ; 
 	 	 m e m P r o f i t L i s t [ i d ]   =   s e q u e n c e O n P r o f i t ; 
 	 } 
 
 	 b o o l   l o s s R e s e t       =   f a l s e ; 
 	 b o o l   p r o f i t R e s e t   =   f a l s e ; 
 
 	 i f   ( p r o f i t O r L o s s   = =   - 1   & &   m e m L o s s L i s t [ i d ]   = =   " " ) 
 	 { 
 	 	 l o s s R e s e t                   =   t r u e ; 
 	 	 m e m P r o f i t L i s t [ i d ]   =   " " ; 
 	 } 
 
 	 i f   ( p r o f i t O r L o s s   = =   1   & &   m e m P r o f i t L i s t [ i d ]   = =   " " ) 
 	 { 
 	 	 p r o f i t R e s e t           =   t r u e ; 
 	 	 m e m L o s s L i s t [ i d ]   =   " " ; 
 	 } 
 
 	 i f   ( p r o f i t O r L o s s   = =   1   | |   m e m L o s s L i s t [ i d ]   = =   " " ) 
 	 { 
 	 	 m e m L o s s L i s t [ i d ]   =   s e q u e n c e O n L o s s ; 
 
 	 	 i f   ( l o s s R e s e t )   { 
 	 	 	 m e m L o s s L i s t [ i d ]   =   " 1 , "   +   m e m L o s s L i s t [ i d ] ; 
 	 	 } 
 	 } 
 
 	 i f   ( p r o f i t O r L o s s   = =   - 1   | |   m e m P r o f i t L i s t [ i d ]   = =   " " ) 
 	 { 
 	 	 m e m P r o f i t L i s t [ i d ]   =   s e q u e n c e O n P r o f i t ; 
 
 	 	 i f   ( p r o f i t R e s e t )   { 
 	 	 	 m e m P r o f i t L i s t [ i d ]   =   " 1 , "   +   m e m P r o f i t L i s t [ i d ] ; 
 	 	 } 
 	 } 
 
 	 i f   ( m e m T i c k e t [ i d ]   = =   ( l o n g ) O r d e r T i c k e t ( ) ) 
 	 { 
 	 	 / /   N o r m a l l y   t h e   l a s t   k n o w n   t i c k e t   ( m e m T i c k e t [ i d ] )   s h o u l d   b e   d i f f e r e n t   t h a n   O d e r T i c k e t ( ) 
 	 	 / /   w h e n   f a i l e d   t o   c r e a t e   a   n e w   t r a d e ,   t h e   l a s t   t i c k e t   r e m a i n s   t h e   s a m e 
 	 	 / /   s o   w e   n e e d   t o   r e s e t 
 	 	 m e m L o s s L i s t [ i d ]       =   s e q u e n c e O n L o s s ; 
 	 	 m e m P r o f i t L i s t [ i d ]   =   s e q u e n c e O n P r o f i t ; 
 	 } 
 
 	 m e m T i c k e t [ i d ]   =   ( l o n g ) O r d e r T i c k e t ( ) ; 
 
 	 / / -   n o w   t u r n   t h e   s t r i n g   i n t o   i n t e g e r   a r r a y 
 	 i n t   s   =   0 ; 
 	 d o u b l e   l i s t L o s s [ ] ; 
 	 d o u b l e   l i s t P r o f i t [ ] ; 
 	 s t r i n g   l i s t S [ ] ; 
 
 	 S t r i n g E x p l o d e ( " , " ,   m e m L o s s L i s t [ i d ] ,   l i s t S ) ; 
 	 A r r a y R e s i z e ( l i s t L o s s ,   A r r a y S i z e ( l i s t S ) ,   A r r a y S i z e ( l i s t S ) ) ; 
 
 	 f o r   ( s   =   0 ;   s   <   A r r a y S i z e ( l i s t S ) ;   s + + ) 
 	 { 
 	 	 l i s t L o s s [ s ]   =   ( d o u b l e ) S t r i n g T o D o u b l e ( S t r i n g T r i m ( l i s t S [ s ] ) ) ;     
 	 } 
 
 	 S t r i n g E x p l o d e ( " , " ,   m e m P r o f i t L i s t [ i d ] ,   l i s t S ) ; 
 	 A r r a y R e s i z e ( l i s t P r o f i t ,   A r r a y S i z e ( l i s t S ) ,   A r r a y S i z e ( l i s t S ) ) ; 
 
 	 f o r   ( s   =   0 ;   s   <   A r r a y S i z e ( l i s t S ) ;   s + + ) 
 	 { 
 	 	 l i s t P r o f i t [ s ]   =   ( d o u b l e ) S t r i n g T o D o u b l e ( S t r i n g T r i m ( l i s t S [ s ] ) ) ;     
 	 } 
 
 	 / / - - 
 	 d o u b l e   m i n L o t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ V O L U M E _ M I N ) ; 
 
 	 i f   ( i n i t i a l L o t s   <   m i n L o t ) 
 	 { 
 	 	 i n i t i a l L o t s   =   m i n L o t ;     
 	 } 
 
 	 i f   ( l o t s   = =   0 ) 
 	 { 
 	 	 l o t s   =   i n i t i a l L o t s ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( 
 	 	 	       ( r e v e r s e   = =   f a l s e   & &   p r o f i t O r L o s s   = = 1 ) 
 	 	 	 | |   ( r e v e r s e   = =   t r u e   & &   p r o f i t O r L o s s   = =   - 1 ) 
 	 	 )   { 
 	 	 	 l o t s   =   i n i t i a l L o t s   *   l i s t P r o f i t [ 0 ] ; 
 
 	 	 	 / /   s h i f t   a r r a y   1   s t e p   l e f t 
 	 	 	 i n t   s i z e   =   A r r a y S i z e ( l i s t P r o f i t ) ; 
 
 	 	 	 f o r ( i n t   p o s   =   0 ;   p o s   <   s i z e - 1 ;   p o s + + ) 
 	 	 	 { 
 	 	 	 	 l i s t P r o f i t [ p o s ]   =   l i s t P r o f i t [ p o s + 1 ] ; 
 	 	 	 } 
 
 	 	 	 i f   ( s i z e   >   0 ) 
 	 	 	 { 
 	 	 	 	 A r r a y R e s i z e ( l i s t P r o f i t ,   s i z e - 1 ,   s i z e - 1 ) ; 
 	 	 	 	 m e m P r o f i t L i s t [ i d ]   =   S t r i n g I m p l o d e ( " , " ,   l i s t P r o f i t ) ; 
 	 	 	 } 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 l o t s   =   i n i t i a l L o t s   *   l i s t L o s s [ 0 ] ; 
 
 	 	 	 / /   s h i f t   a r r a y   1   s t e p   l e f t 
 	 	 	 i n t   s i z e   =   A r r a y S i z e ( l i s t L o s s ) ; 
 
 	 	 	 f o r ( i n t   p o s   =   0 ;   p o s   <   s i z e - 1 ;   p o s + + ) 
 	 	 	 { 
 	 	 	 	 l i s t L o s s [ p o s ]   =   l i s t L o s s [ p o s + 1 ] ; 
 	 	 	 } 
 
 	 	 	 i f   ( s i z e   >   0 ) 
 	 	 	 { 
 	 	 	 	 A r r a y R e s i z e ( l i s t L o s s ,   s i z e - 1 ,   s i z e - 1 ) ; 
 	 	 	 	 m e m L o s s L i s t [ i d ]   =   S t r i n g I m p l o d e ( " , " ,   l i s t L o s s ) ; 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 r e t u r n   l o t s ; 
 }  
  
 i n t   B u y N o w ( 
 	 s t r i n g   s y m b o l , 
 	 d o u b l e   l o t s , 
 	 d o u b l e   s l l , 
 	 d o u b l e   t p l , 
 	 d o u b l e   s l p , 
 	 d o u b l e   t p p , 
 	 d o u b l e   s l i p p a g e   =   0 , 
 	 i n t   m a g i c   =   0 , 
 	 s t r i n g   c o m m e n t   =   " " , 
 	 c o l o r   a r r o w c o l o r   =   c l r N O N E , 
 	 d a t e t i m e   e x p i r a t i o n   =   0 
 	 ) 
 { 
 	 r e t u r n   O r d e r C r e a t e ( 
 	 	 s y m b o l , 
 	 	 O P _ B U Y , 
 	 	 l o t s , 
 	 	 0 , 
 	 	 s l l , 
 	 	 t p l , 
 	 	 s l p , 
 	 	 t p p , 
 	 	 s l i p p a g e , 
 	 	 m a g i c , 
 	 	 c o m m e n t , 
 	 	 a r r o w c o l o r , 
 	 	 e x p i r a t i o n 
 	 ) ; 
 }  
  
 i n t   C h e c k F o r T r a d i n g E r r o r ( i n t   e r r o r _ c o d e = - 1 ,   s t r i n g   m s g _ p r e f i x = " " ) 
 { 
       / /   r e t u r n   0   - >   n o   e r r o r 
       / /   r e t u r n   1   - >   o v e r c o m a b l e   e r r o r 
       / /   r e t u r n   2   - >   f a t a l   e r r o r 
       
       i f   ( e r r o r _ c o d e < 0 )   { 
             e r r o r _ c o d e = G e t L a s t E r r o r ( ) ;     
       } 
       
       i n t   r e t v a l = 0 ; 
       s t a t i c   i n t   t r y o u t s = 0 ; 
       
       / / - -   e r r o r   c h e c k   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
       s w i t c h ( e r r o r _ c o d e ) 
       { 
             / / - -   n o   e r r o r 
             c a s e   0 : 
                   r e t v a l = 0 ; 
                   b r e a k ; 
             / / - -   o v e r c o m a b l e   e r r o r s 
             c a s e   1 :   / /   N o   e r r o r   r e t u r n e d 
                   R e f r e s h R a t e s ( ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   4 :   / / E R R _ S E R V E R _ B U S Y 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   S l e e p ( 1 0 0 0 ) ; 
                   R e f r e s h R a t e s ( ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   6 :   / / E R R _ N O _ C O N N E C T I O N 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   w h i l e ( ! I s C o n n e c t e d ( ) )   { S l e e p ( 1 0 0 ) ; } 
                   w h i l e ( I s T r a d e C o n t e x t B u s y ( ) )   { S l e e p ( 5 0 ) ; } 
                   R e f r e s h R a t e s ( ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 2 8 :   / / E R R _ T R A D E _ T I M E O U T 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   R e f r e s h R a t e s ( ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 2 9 :   / / E R R _ I N V A L I D _ P R I C E 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   i f   ( ! I s T e s t i n g ( ) )   { w h i l e ( R e f r e s h R a t e s ( ) = = f a l s e )   { S l e e p ( 1 ) ; } } 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 3 0 :   / / E R R _ I N V A L I D _ S T O P S 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   W a i t i n g   f o r   a   n e w   t i c k   t o   r e t r y . . " ) ) ; } 
                   i f   ( ! I s T e s t i n g ( ) )   { w h i l e ( R e f r e s h R a t e s ( ) = = f a l s e )   { S l e e p ( 1 ) ; } } 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 3 5 :   / / E R R _ P R I C E _ C H A N G E D 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   W a i t i n g   f o r   a   n e w   t i c k   t o   r e t r y . . " ) ) ; } 
                   i f   ( ! I s T e s t i n g ( ) )   { w h i l e ( R e f r e s h R a t e s ( ) = = f a l s e )   { S l e e p ( 1 ) ; } } 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 3 6 :   / / E R R _ O F F _ Q U O T E S 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   W a i t i n g   f o r   a   n e w   t i c k   t o   r e t r y . . " ) ) ; } 
                   i f   ( ! I s T e s t i n g ( ) )   { w h i l e ( R e f r e s h R a t e s ( ) = = f a l s e )   { S l e e p ( 1 ) ; } } 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 3 7 :   / / E R R _ B R O K E R _ B U S Y 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   S l e e p ( 1 0 0 0 ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 3 8 :   / / E R R _ R E Q U O T E 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   W a i t i n g   f o r   a   n e w   t i c k   t o   r e t r y . . " ) ) ; } 
                   i f   ( ! I s T e s t i n g ( ) )   { w h i l e ( R e f r e s h R a t e s ( ) = = f a l s e )   { S l e e p ( 1 ) ; } } 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 4 2 :   / / T h i s   c o d e   s h o u l d   b e   p r o c e s s e d   i n   t h e   s a m e   w a y   a s   e r r o r   1 2 8 . 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   R e f r e s h R a t e s ( ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             c a s e   1 4 3 :   / / T h i s   c o d e   s h o u l d   b e   p r o c e s s e d   i n   t h e   s a m e   w a y   a s   e r r o r   1 2 8 . 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   R e f r e s h R a t e s ( ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             / * c a s e   1 4 5 :   / / E R R _ T R A D E _ M O D I F Y _ D E N I E D 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   W a i t i n g   f o r   a   n e w   t i c k   t o   r e t r y . . " ) ) ; } 
                   w h i l e ( R e f r e s h R a t e s ( ) = = f a l s e )   { S l e e p ( 1 ) ; } 
                   r e t u r n ( 1 ) ; 
             * / 
             c a s e   1 4 6 :   / / E R R _ T R A D E _ C O N T E X T _ B U S Y 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) , " .   R e t r y i n g . . " ) ) ; } 
                   w h i l e ( I s T r a d e C o n t e x t B u s y ( ) )   { S l e e p ( 5 0 ) ; } 
                   R e f r e s h R a t e s ( ) ; 
                   r e t v a l = 1 ; 
                   b r e a k ; 
             / / - -   c r i t i c a l   e r r o r s 
             d e f a u l t : 
                   i f   ( m s g _ p r e f i x ! = " " )   { P r i n t ( S t r i n g C o n c a t e n a t e ( m s g _ p r e f i x , " :   " , E r r o r M e s s a g e ( e r r o r _ c o d e ) ) ) ; } 
                   r e t v a l = 2 ; 
                   b r e a k ; 
       } 
 
       i f   ( r e t v a l = = 0 )   { t r y o u t s = 0 ; } 
       e l s e   i f   ( r e t v a l = = 1 )   { 
             t r y o u t s + + ; 
             i f   ( t r y o u t s > = 1 0 )   { 
                   t r y o u t s = 0 ; 
                   r e t v a l = 2 ; 
             }   e l s e   { 
                   P r i n t ( " r e t r y   # " + ( s t r i n g ) t r y o u t s + "   o f   1 0 " ) ; 
             } 
       } 
       
       r e t u r n ( r e t v a l ) ; 
 }  
  
 b o o l   C l o s e T r a d e ( u l o n g   t i c k e t ,   u l o n g   s l i p p a g e   =   0 ,   c o l o r   a r r o w c o l o r   =   C L R _ N O N E ) 
 { 
 	 b o o l   s u c c e s s   =   f a l s e ; 
 	 b o o l   e x i s t s     =   f a l s e ; 
 	 
 	 f o r   ( i n t   i   =   0 ;   i   <   O r d e r s T o t a l ( ) ;   i + + ) 
 	 { 
 	 	 i f   ( ! O r d e r S e l e c t ( i ,   S E L E C T _ B Y _ P O S ,   M O D E _ T R A D E S ) )   c o n t i n u e ; 
 
 	 	 i f   ( O r d e r T i c k e t ( )   = =   t i c k e t ) 
 	 	 { 
 	 	 	 e x i s t s   =   t r u e ; 
 	 	 	 b r e a k ; 
 	 	 } 
 	 } 
 
 	 i f   ( e x i s t s   = =   f a l s e ) 
 	 { 
 	 	 r e t u r n   f a l s e ; 
 	 } 
 
 	 w h i l e   ( t r u e ) 
 	 { 
 	 	 / / - -   w a i t   i f   n e e d e d   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 W a i t T r a d e C o n t e x t I f B u s y ( ) ; 
 
 	 	 / / - -   c l o s e   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 s u c c e s s   =   O r d e r C l o s e ( ( i n t ) t i c k e t ,   O r d e r L o t s ( ) ,   O r d e r C l o s e P r i c e ( ) ,   ( i n t ) ( s l i p p a g e   *   P i p V a l u e ( O r d e r S y m b o l ( ) ) ) ,   a r r o w c o l o r ) ; 
 
 	 	 i f   ( s u c c e s s   = =   t r u e ) 
 	 	 { 
 	 	 	 i f   ( U S E _ V I R T U A L _ S T O P S )   { 
 	 	 	 	 V i r t u a l S t o p s D r i v e r ( " c l e a r " ,   t i c k e t ) ; 
 	 	 	 } 
 
 	 	 	 e x p i r a t i o n W o r k e r . R e m o v e E x p i r a t i o n ( t i c k e t ) ; 
 
 	 	 	 O n T r a d e ( ) ; 
 
 	 	 	 r e t u r n   t r u e ; 
 	 	 } 
 
 	 	 / / - -   e r r o r s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 i n t   e r r a c t i o n   =   C h e c k F o r T r a d i n g E r r o r ( G e t L a s t E r r o r ( ) ,   " C l o s i n g   t r a d e   # "   +   ( s t r i n g ) t i c k e t   +   "   e r r o r " ) ; 
 
 	 	 s w i t c h ( e r r a c t i o n ) 
 	 	 { 
 	 	 	 c a s e   0 :   b r e a k ;         / /   n o   e r r o r 
 	 	 	 c a s e   1 :   c o n t i n u e ;   / /   o v e r c o m a b l e   e r r o r 
 	 	 	 c a s e   2 :   b r e a k ;         / /   f a t a l   e r r o r 
 	 	 } 
 
 	 	 b r e a k ; 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 t e m p l a t e < t y p e n a m e   D T 1 ,   t y p e n a m e   D T 2 > 
 b o o l   C o m p a r e V a l u e s ( s t r i n g   s i g n ,   D T 1   v 1 ,   D T 2   v 2 ) 
 { 
 	           i f   ( s i g n   = =   " > " )   r e t u r n ( v 1   >   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " < " )   r e t u r n ( v 1   <   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " > = " )   r e t u r n ( v 1   > =   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " < = " )   r e t u r n ( v 1   < =   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " = = " )   r e t u r n ( v 1   = =   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " ! = " )   r e t u r n ( v 1   ! =   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " x > " )   r e t u r n ( v 1   >   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " x < " )   r e t u r n ( v 1   <   v 2 ) ; 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 s t r i n g   C u r r e n t S y m b o l ( s t r i n g   s y m b o l   =   " " ) 
 { 
       s t a t i c   s t r i n g   m e m o r y   =   " " ; 
 
 	 / /   S e t 
       i f   ( s y m b o l   ! =   " " ) 
 	 { 
 	 	 m e m o r y   =   s y m b o l ; 
 	 } 
 	 / /   G e t 
 	 e l s e   i f   ( m e m o r y   = =   " " ) 
 	 { 
 	 	 m e m o r y   =   S y m b o l ( ) ; 
 	 } 
 
       r e t u r n   m e m o r y ; 
 }  
  
 E N U M _ T I M E F R A M E S   C u r r e n t T i m e f r a m e ( E N U M _ T I M E F R A M E S   t i m e f r a m e   =   - 1 ) 
 { 
 	 s t a t i c   E N U M _ T I M E F R A M E S   m e m o r y   =   0 ; 
 
       i f   ( t i m e f r a m e   > =   0 )   { m e m o r y   =   t i m e f r a m e ; } 
 
       r e t u r n   m e m o r y ; 
 }  
  
 d o u b l e   C u s t o m P o i n t ( s t r i n g   s y m b o l ) 
 { 
 	 s t a t i c   s t r i n g   s y m b o l s [ ] ; 
 	 s t a t i c   d o u b l e   p o i n t s [ ] ; 
 	 s t a t i c   s t r i n g   l a s t _ s y m b o l   =   " - " ; 
 	 s t a t i c   d o u b l e   l a s t _ p o i n t     =   0 ; 
 	 s t a t i c   i n t   l a s t _ i                   =   0 ; 
 	 s t a t i c   i n t   s i z e                       =   0 ; 
 
 	 / / - -   v a r i a n t   A )   u s e   t h e   c a c h e   f o r   t h e   l a s t   u s e d   s y m b o l 
 	 i f   ( s y m b o l   = =   l a s t _ s y m b o l ) 
 	 { 
 	 	 r e t u r n   l a s t _ p o i n t ; 
 	 } 
 
 	 / / - -   v a r i a n t   B )   s e a r c h   i n   t h e   a r r a y   c a c h e 
 	 i n t   i 	 	 	 =   l a s t _ i ; 
 	 i n t   s t a r t _ i 	 =   i ; 
 	 b o o l   f o u n d 	 =   f a l s e ; 
 
 	 i f   ( s i z e   >   0 ) 
 	 { 
 	 	 w h i l e   ( t r u e ) 
 	 	 { 
 	 	 	 i f   ( s y m b o l s [ i ]   = =   s y m b o l ) 
 	 	 	 { 
 	 	 	 	 l a s t _ s y m b o l 	 =   s y m b o l ; 
 	 	 	 	 l a s t _ p o i n t 	 =   p o i n t s [ i ] ; 
 	 	 	 	 l a s t _ i 	 	 =   i ; 
 
 	 	 	 	 r e t u r n   l a s t _ p o i n t ; 
 	 	 	 } 
 
 	 	 	 i + + ; 
 
 	 	 	 i f   ( i   > =   s i z e ) 
 	 	 	 { 
 	 	 	 	 i   =   0 ; 
 	 	 	 } 
 	 	 	 i f   ( i   = =   s t a r t _ i )   { b r e a k ; } 
 	 	 } 
 	 } 
 
 	 / / - -   v a r i a n t   C )   a d d   t h i s   s y m b o l   t o   t h e   c a c h e 
 	 i 	 	 =   s i z e ; 
 	 s i z e 	 =   s i z e   +   1 ; 
 
 	 A r r a y R e s i z e ( s y m b o l s ,   s i z e ) ; 
 	 A r r a y R e s i z e ( p o i n t s ,   s i z e ) ; 
 
 	 s y m b o l s [ i ] 	 =   s y m b o l ; 
 	 p o i n t s [ i ] 	 =   0 ; 
 	 l a s t _ s y m b o l 	 =   s y m b o l ; 
 	 l a s t _ i 	 	 =   i ; 
 
 	 / / - -   u n s e r i a l i z e   r u l e s   f r o m   F X D _ P O I N T _ F O R M A T _ R U L E S 
 	 s t r i n g   r u l e s [ ] ; 
 	 S t r i n g E x p l o d e ( " , " ,   P O I N T _ F O R M A T _ R U L E S ,   r u l e s ) ; 
 
 	 i n t   r u l e s _ c o u n t   =   A r r a y S i z e ( r u l e s ) ; 
 
 	 i f   ( r u l e s _ c o u n t   >   0 ) 
 	 { 
 	 	 s t r i n g   r u l e [ ] ; 
 
 	 	 f o r   ( i n t   r   =   0 ;   r   <   r u l e s _ c o u n t ;   r + + ) 
 	 	 { 
 	 	 	 S t r i n g E x p l o d e ( " = " ,   r u l e s [ r ] ,   r u l e ) ; 
 
 	 	 	 / / - -   a   s i n g l e   r u l e   m u s t   c o n t a i n   2   p a r t s ,   [ 0 ]   f r o m   a n d   [ 1 ]   t o 
 	 	 	 i f   ( A r r a y S i z e ( r u l e )   ! =   2 )   { c o n t i n u e ; } 
 
 	 	 	 d o u b l e   f r o m   =   S t r i n g T o D o u b l e ( r u l e [ 0 ] ) ; 
 	 	 	 d o u b l e   t o 	 =   S t r i n g T o D o u b l e ( r u l e [ 1 ] ) ; 
 
 	 	 	 / / - -   " t o "   m u s t   b e   a   p o s i t i v e   n u m b e r ,   d i f f e r e n t   t h a n   0 
 	 	 	 i f   ( t o   < =   0 )   { c o n t i n u e ; } 
 
 	 	 	 / / - -   " f r o m "   c a n   b e   a   n u m b e r   o r   a   s t r i n g 
 	 	 	 / /   a )   s t r i n g 
 	 	 	 i f   ( f r o m   = =   0   & &   S t r i n g L e n ( r u l e [ 0 ] )   >   0 ) 
 	 	 	 { 
 	 	 	 	 s t r i n g   s _ f r o m   =   r u l e [ 0 ] ; 
 	 	 	 	 i n t   p o s               =   S t r i n g F i n d ( s _ f r o m ,   " ? " ) ; 
 
 	 	 	 	 i f   ( p o s   <   0 )   / /   ?   n o t   f o u n d 
 	 	 	 	 { 
 	 	 	 	 	 i f   ( S t r i n g F i n d ( s y m b o l ,   s _ f r o m )   = =   0 )   { p o i n t s [ i ]   =   t o ; } 
 	 	 	 	 } 
 	 	 	 	 e l s e   i f   ( p o s   = =   0 )   / /   ?   i s   t h e   f i r s t   s y m b o l   = >   m a t c h   t h e   s e c o n d   s y m b o l 
 	 	 	 	 { 
 	 	 	 	 	 i f   ( S t r i n g F i n d ( s y m b o l ,   S t r i n g S u b s t r ( s _ f r o m ,   1 ) ,   3 )   = =   3 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 p o i n t s [ i ]   =   t o ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 	 e l s e   i f   ( p o s   >   0 )   / /   ?   i s   t h e   s e c o n d   s y m b o l   = >   m a t c h   t h e   f i r s t   s y m b o l 
 	 	 	 	 { 
 	 	 	 	 	 i f   ( S t r i n g F i n d ( s y m b o l ,   S t r i n g S u b s t r ( s _ f r o m ,   0 ,   p o s ) )   = =   0 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 p o i n t s [ i ]   =   t o ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 / /   b )   n u m b e r 
 	 	 	 i f   ( f r o m   = =   0 )   { c o n t i n u e ; } 
 
 	 	 	 i f   ( S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T )   = =   f r o m ) 
 	 	 	 { 
 	 	 	 	 p o i n t s [ i ]   =   t o ; 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 i f   ( p o i n t s [ i ]   = =   0 ) 
 	 { 
 	 	 p o i n t s [ i ]   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ; 
 	 } 
 
 	 l a s t _ p o i n t   =   p o i n t s [ i ] ; 
 
 	 r e t u r n   l a s t _ p o i n t ; 
 }  
  
 b o o l   D e l e t e O r d e r ( i n t   t i c k e t ,   c o l o r   a r r o w c o l o r = c l r N O N E ) 
 { 
       b o o l   s u c c e s s = f a l s e ; 
       i f   ( ! O r d e r S e l e c t ( t i c k e t , S E L E C T _ B Y _ T I C K E T , M O D E _ T R A D E S ) )   { r e t u r n ( f a l s e ) ; } 
       
       w h i l e ( t r u e ) 
       { 
             / / - -   w a i t   i f   n e e d e d   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
             W a i t T r a d e C o n t e x t I f B u s y ( ) ; 
             / / - -   d e l e t e   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
             s u c c e s s = O r d e r D e l e t e ( t i c k e t , a r r o w c o l o r ) ; 
             i f   ( s u c c e s s = = t r u e )   { 
                   i f   ( U S E _ V I R T U A L _ S T O P S )   { 
                         V i r t u a l S t o p s D r i v e r ( " c l e a r " , t i c k e t ) ; 
                   } 
                   O n T r a d e ( ) ; 
                   r e t u r n ( t r u e ) ; 
             } 
             / / - -   e r r o r   c h e c k   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
             i n t   e r r a c t i o n = C h e c k F o r T r a d i n g E r r o r ( G e t L a s t E r r o r ( ) ,   " D e l e t i n g   o r d e r   # " + ( s t r i n g ) t i c k e t + "   e r r o r " ) ; 
             s w i t c h ( e r r a c t i o n ) 
             { 
                   c a s e   0 :   b r e a k ;         / /   n o   e r r o r 
                   c a s e   1 :   c o n t i n u e ;   / /   o v e r c o m a b l e   e r r o r 
                   c a s e   2 :   b r e a k ;         / /   f a t a l   e r r o r 
             } 
             b r e a k ; 
       } 
       r e t u r n ( f a l s e ) ; 
 }  
  
 v o i d   D r a w S p r e a d I n f o ( ) 
 { 
       s t a t i c   b o o l   a l l o w _ d r a w   =   t r u e ; 
       i f   ( a l l o w _ d r a w = = f a l s e )   { r e t u r n ; } 
       i f   ( M Q L I n f o I n t e g e r ( M Q L _ T E S T E R )   & &   ! M Q L I n f o I n t e g e r ( M Q L _ V I S U A L _ M O D E ) )   { a l l o w _ d r a w = f a l s e ; }   / /   A l l o w e d   t o   d r a w   o n l y   o n c e   i n   t e s t i n g   m o d e 
 
       s t a t i c   b o o l   p a s s e d                   =   f a l s e ; 
       s t a t i c   d o u b l e   m a x _ s p r e a d       =   0 ; 
       s t a t i c   d o u b l e   m i n _ s p r e a d       =   E M P T Y _ V A L U E ; 
       s t a t i c   d o u b l e   a v g _ s p r e a d       =   0 ; 
       s t a t i c   d o u b l e   a v g _ a d d             =   0 ; 
       s t a t i c   d o u b l e   a v g _ c n t             =   0 ; 
 
       d o u b l e   c u s t o m _ p o i n t   =   C u s t o m P o i n t ( S y m b o l ( ) ) ; 
       d o u b l e   c u r r e n t _ s p r e a d   =   0 ; 
       i f   ( c u s t o m _ p o i n t   >   0 )   { 
             c u r r e n t _ s p r e a d   =   ( S y m b o l I n f o D o u b l e ( S y m b o l ( ) , S Y M B O L _ A S K ) - S y m b o l I n f o D o u b l e ( S y m b o l ( ) , S Y M B O L _ B I D ) ) / c u s t o m _ p o i n t ; 
       } 
       i f   ( c u r r e n t _ s p r e a d   >   m a x _ s p r e a d )   { m a x _ s p r e a d   =   c u r r e n t _ s p r e a d ; } 
       i f   ( c u r r e n t _ s p r e a d   <   m i n _ s p r e a d )   { m i n _ s p r e a d   =   c u r r e n t _ s p r e a d ; } 
       
       a v g _ c n t + + ; 
       a v g _ a d d           =   a v g _ a d d   +   c u r r e n t _ s p r e a d ; 
       a v g _ s p r e a d     =   a v g _ a d d   /   a v g _ c n t ; 
 
       i n t   x = 0 ;   i n t   y = 0 ; 
       s t r i n g   n a m e ; 
 
       / /   c r e a t e   o b j e c t s 
       i f   ( p a s s e d   = =   f a l s e ) 
       { 
             p a s s e d = t r u e ; 
             
             n a m e = " f x d _ s p r e a d _ c u r r e n t _ l a b e l " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 1 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   1 8 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r D a r k O r a n g e ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " S p r e a d : " ) ; 
             } 
             n a m e = " f x d _ s p r e a d _ m a x _ l a b e l " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 1 4 8 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r O r a n g e R e d ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " m a x : " ) ; 
             } 
             n a m e = " f x d _ s p r e a d _ a v g _ l a b e l " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 1 4 8 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 9 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r D a r k O r a n g e ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " a v g : " ) ; 
             } 
             n a m e = " f x d _ s p r e a d _ m i n _ l a b e l " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 1 4 8 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r G o l d ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " m i n : " ) ; 
             } 
             n a m e = " f x d _ s p r e a d _ c u r r e n t " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 9 3 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   1 8 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r D a r k O r a n g e ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " 0 " ) ; 
             } 
             n a m e = " f x d _ s p r e a d _ m a x " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 1 7 3 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r O r a n g e R e d ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " 0 " ) ; 
             } 
             n a m e = " f x d _ s p r e a d _ a v g " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 1 7 3 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 9 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r D a r k O r a n g e ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " 0 " ) ; 
             } 
             n a m e = " f x d _ s p r e a d _ m i n " ; 
             i f   ( O b j e c t F i n d ( 0 ,   n a m e ) = = - 1 )   { 
                   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 1 7 3 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ F O N T S I Z E ,   7 ) ; 
                   O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   c l r G o l d ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ; 
                   O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   " 0 " ) ; 
             } 
       } 
       
       O b j e c t S e t S t r i n g ( 0 ,   " f x d _ s p r e a d _ c u r r e n t " ,   O B J P R O P _ T E X T ,   D o u b l e T o S t r ( c u r r e n t _ s p r e a d , 2 ) ) ; 
       O b j e c t S e t S t r i n g ( 0 ,   " f x d _ s p r e a d _ m a x " ,   O B J P R O P _ T E X T ,   D o u b l e T o S t r ( m a x _ s p r e a d , 2 ) ) ; 
       O b j e c t S e t S t r i n g ( 0 ,   " f x d _ s p r e a d _ a v g " ,   O B J P R O P _ T E X T ,   D o u b l e T o S t r ( a v g _ s p r e a d , 2 ) ) ; 
       O b j e c t S e t S t r i n g ( 0 ,   " f x d _ s p r e a d _ m i n " ,   O B J P R O P _ T E X T ,   D o u b l e T o S t r ( m i n _ s p r e a d , 2 ) ) ; 
 }  
  
 s t r i n g   D r a w S t a t u s ( s t r i n g   t e x t = " " )  
 {  
       s t a t i c   s t r i n g   m e m o r y ;  
       i f   ( t e x t = = " " )   {  
             r e t u r n ( m e m o r y ) ;  
       }  
        
       s t a t i c   b o o l   p a s s e d   =   f a l s e ;  
       i n t   x = 2 1 0 ;   i n t   y = 0 ;  
       s t r i n g   n a m e ;  
  
       / / - -   d r a w   t h e   o b j e c t s   o n c e  
       i f   ( p a s s e d   = =   f a l s e )  
       {  
             p a s s e d   =   t r u e ;  
             n a m e = " f x d _ s t a t u s _ t i t l e " ;  
             O b j e c t C r e a t e ( 0 , n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ B A C K ,   f a l s e ) ;  
             O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ;  
             O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ;  
             O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ X D I S T A N C E ,   x ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 7 ) ;  
             O b j e c t S e t S t r i n g ( 0 , n a m e ,   O B J P R O P _ T E X T ,   " S t a t u s " ) ;  
             O b j e c t S e t S t r i n g ( 0 , n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ F O N T S I Z E ,   7 ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ C O L O R ,   c l r G r a y ) ;  
              
             n a m e = " f x d _ s t a t u s _ t e x t " ;  
             O b j e c t C r e a t e ( 0 , n a m e ,   O B J _ L A B E L ,   0 ,   0 ,   0 ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ B A C K ,   f a l s e ) ;  
             O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O R N E R ,   C O R N E R _ L E F T _ L O W E R ) ;  
             O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ L E F T _ L O W E R ) ;  
             O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ X D I S T A N C E ,   x + 2 ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ Y D I S T A N C E ,   y + 1 ) ;  
             O b j e c t S e t S t r i n g ( 0 , n a m e ,   O B J P R O P _ F O N T ,   " A r i a l " ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ F O N T S I Z E ,   1 2 ) ;  
             O b j e c t S e t I n t e g e r ( 0 , n a m e ,   O B J P R O P _ C O L O R ,   c l r A q u a ) ;  
       }  
  
       / / - -   u p d a t e   t h e   t e x t   w h e n   n e e d e d  
       i f   ( t e x t   ! =   m e m o r y )   {  
             m e m o r y = t e x t ;  
             O b j e c t S e t S t r i n g ( 0 , " f x d _ s t a t u s _ t e x t " ,   O B J P R O P _ T E X T ,   t e x t ) ;  
       }  
        
       r e t u r n ( t e x t ) ;  
 }  
  
 d o u b l e   D y n a m i c L o t s ( s t r i n g   s y m b o l ,   s t r i n g   m o d e = " b a l a n c e " ,   d o u b l e   v a l u e = 0 ,   d o u b l e   s l = 0 ,   s t r i n g   a l i g n = " a l i g n " ,   d o u b l e   R J F R _ i n i t i a l _ l o t s = 0 ) 
 { 
       d o u b l e   s i z e = 0 ; 
       d o u b l e   L o t S t e p = M a r k e t I n f o ( s y m b o l , M O D E _ L O T S T E P ) ; 
       d o u b l e   L o t S i z e = M a r k e t I n f o ( s y m b o l , M O D E _ L O T S I Z E ) ; 
       d o u b l e   M i n L o t s = M a r k e t I n f o ( s y m b o l , M O D E _ M I N L O T ) ; 
       d o u b l e   M a x L o t s = M a r k e t I n f o ( s y m b o l , M O D E _ M A X L O T ) ; 
       d o u b l e   T i c k V a l u e = M a r k e t I n f o ( s y m b o l , M O D E _ T I C K V A L U E ) ; 
       d o u b l e   p o i n t = M a r k e t I n f o ( s y m b o l , M O D E _ P O I N T ) ; 
       d o u b l e   t i c k s i z e = M a r k e t I n f o ( s y m b o l , M O D E _ T I C K S I Z E ) ; 
       d o u b l e   m a r g i n _ r e q u i r e d = M a r k e t I n f o ( s y m b o l , M O D E _ M A R G I N R E Q U I R E D ) ; 
       
       i f   ( m o d e = = " f i x e d "   | |   m o d e = = " l o t s " )           { s i z e = v a l u e ; } 
       e l s e   i f   ( m o d e = = " b l o c k - e q u i t y " )             { s i z e = ( v a l u e / 1 0 0 ) * A c c o u n t E q u i t y ( ) / m a r g i n _ r e q u i r e d ; } 
       e l s e   i f   ( m o d e = = " b l o c k - b a l a n c e " )           { s i z e = ( v a l u e / 1 0 0 ) * A c c o u n t B a l a n c e ( ) / m a r g i n _ r e q u i r e d ; } 
       e l s e   i f   ( m o d e = = " b l o c k - f r e e m a r g i n " )     { s i z e = ( v a l u e / 1 0 0 ) * A c c o u n t F r e e M a r g i n ( ) / m a r g i n _ r e q u i r e d ; } 
       e l s e   i f   ( m o d e = = " e q u i t y " )             { s i z e = ( v a l u e / 1 0 0 ) * A c c o u n t E q u i t y ( ) / ( L o t S i z e * T i c k V a l u e ) ; } 
       e l s e   i f   ( m o d e = = " b a l a n c e " )           { s i z e = ( v a l u e / 1 0 0 ) * A c c o u n t B a l a n c e ( ) / ( L o t S i z e * T i c k V a l u e ) ; } 
       e l s e   i f   ( m o d e = = " f r e e m a r g i n " )     { s i z e = ( v a l u e / 1 0 0 ) * A c c o u n t F r e e M a r g i n ( ) / ( L o t S i z e * T i c k V a l u e ) ; } 
       e l s e   i f   ( m o d e = = " e q u i t y R i s k " )           { s i z e = ( ( v a l u e / 1 0 0 ) * A c c o u n t E q u i t y ( ) ) / ( s l * ( ( T i c k V a l u e / t i c k s i z e ) * p o i n t ) * P i p V a l u e ( s y m b o l ) ) ; } 
       e l s e   i f   ( m o d e = = " b a l a n c e R i s k " )         { s i z e = ( ( v a l u e / 1 0 0 ) * A c c o u n t B a l a n c e ( ) ) / ( s l * ( ( T i c k V a l u e / t i c k s i z e ) * p o i n t ) * P i p V a l u e ( s y m b o l ) ) ; } 
       e l s e   i f   ( m o d e = = " f r e e m a r g i n R i s k " )   { s i z e = ( ( v a l u e / 1 0 0 ) * A c c o u n t F r e e M a r g i n ( ) ) / ( s l * ( ( T i c k V a l u e / t i c k s i z e ) * p o i n t ) * P i p V a l u e ( s y m b o l ) ) ; } 
       e l s e   i f   ( m o d e = = " f i x e d R i s k " )       { s i z e = ( v a l u e ) / ( s l * ( ( T i c k V a l u e / t i c k s i z e ) * p o i n t ) * P i p V a l u e ( s y m b o l ) ) ; } 
       e l s e   i f   ( m o d e = = " f i x e d R a t i o "   | |   m o d e = = " R J F R " )   { 
             
             / / / / / 
             / /   R y a n   J o n e s   F i x e d   R a t i o   M M   s t a t i c   d a t a 
             s t a t i c   d o u b l e   R J F R _ s t a r t _ l o t s = 0 ; 
             s t a t i c   d o u b l e   R J F R _ d e l t a = 0 ; 
             s t a t i c   d o u b l e   R J F R _ u n i t s = 1 ; 
             s t a t i c   d o u b l e   R J F R _ t a r g e t _ l o w e r = 0 ; 
             s t a t i c   d o u b l e   R J F R _ t a r g e t _ u p p e r = 0 ; 
             / / / / / 
             
             i f   ( R J F R _ s t a r t _ l o t s < = 0 )   { R J F R _ s t a r t _ l o t s = v a l u e ; } 
             i f   ( R J F R _ s t a r t _ l o t s < M i n L o t s )   { R J F R _ s t a r t _ l o t s = M i n L o t s ; } 
             i f   ( R J F R _ d e l t a < = 0 )   { R J F R _ d e l t a = s l ; } 
             i f   ( R J F R _ t a r g e t _ u p p e r < = 0 )   { 
                   R J F R _ t a r g e t _ u p p e r = A c c o u n t E q u i t y ( ) + ( R J F R _ u n i t s * R J F R _ d e l t a ) ; 
                   P r i n t ( " F i x e d   R a t i o   M M :   U n i t s = > " , R J F R _ u n i t s , " ;   D e l t a = " , R J F R _ d e l t a , " ;   U p p e r   T a r g e t   E q u i t y = > " , R J F R _ t a r g e t _ u p p e r ) ; 
             } 
             i f   ( A c c o u n t E q u i t y ( ) > = R J F R _ t a r g e t _ u p p e r ) 
             { 
                   w h i l e ( t r u e )   { 
                         P r i n t ( " F i x e d   R a t i o   M M   g o i n g   u p   t o   " , ( R J F R _ s t a r t _ l o t s * ( R J F R _ u n i t s + 1 ) ) , "   l o t s :   E q u i t y   i s   a b o v e   U p p e r   T a r g e t   E q u i t y   ( " , A c c o u n t E q u i t y ( ) , " > = " , R J F R _ t a r g e t _ u p p e r , " ) " ) ; 
                         R J F R _ u n i t s + + ; 
                         R J F R _ t a r g e t _ l o w e r = R J F R _ t a r g e t _ u p p e r ; 
                         R J F R _ t a r g e t _ u p p e r = R J F R _ t a r g e t _ u p p e r + ( R J F R _ u n i t s * R J F R _ d e l t a ) ; 
                         P r i n t ( " F i x e d   R a t i o   M M :   U n i t s = > " , R J F R _ u n i t s , " ;   D e l t a = " , R J F R _ d e l t a , " ;   L o w e r   T a r g e t   E q u i t y = > " , R J F R _ t a r g e t _ l o w e r , " ;   U p p e r   T a r g e t   E q u i t y = > " , R J F R _ t a r g e t _ u p p e r ) ; 
                         i f   ( A c c o u n t E q u i t y ( ) < R J F R _ t a r g e t _ u p p e r )   { b r e a k ; } 
                   } 
             } 
             e l s e   i f   ( A c c o u n t E q u i t y ( ) < = R J F R _ t a r g e t _ l o w e r ) 
             { 
                   w h i l e ( t r u e )   { 
                   i f   ( A c c o u n t E q u i t y ( ) > R J F R _ t a r g e t _ l o w e r )   { b r e a k ; } 
                         i f   ( R J F R _ u n i t s > 1 )   {                   
                               P r i n t ( " F i x e d   R a t i o   M M   g o i n g   d o w n   t o   " , ( R J F R _ s t a r t _ l o t s * ( R J F R _ u n i t s - 1 ) ) , "   l o t s :   E q u i t y   i s   b e l o w   L o w e r   T a r g e t   E q u i t y   |   " ,   A c c o u n t E q u i t y ( ) , "   < =   " , R J F R _ t a r g e t _ l o w e r , " ) " ) ; 
                               R J F R _ t a r g e t _ u p p e r = R J F R _ t a r g e t _ l o w e r ; 
                               R J F R _ t a r g e t _ l o w e r = R J F R _ t a r g e t _ l o w e r - ( ( R J F R _ u n i t s - 1 ) * R J F R _ d e l t a ) ; 
                               R J F R _ u n i t s - - ; 
                               P r i n t ( " F i x e d   R a t i o   M M :   U n i t s = > " , R J F R _ u n i t s , " ;   D e l t a = " , R J F R _ d e l t a , " ;   L o w e r   T a r g e t   E q u i t y = > " , R J F R _ t a r g e t _ l o w e r , " ;   U p p e r   T a r g e t   E q u i t y = > " , R J F R _ t a r g e t _ u p p e r ) ; 
                         }   e l s e   { b r e a k ; } 
                   } 
             } 
             s i z e = R J F R _ s t a r t _ l o t s * R J F R _ u n i t s ; 
       } 
       
 	 i f   ( s i z e = = E M P T Y _ V A L U E )   { s i z e = 0 ; } 
 	 
       s i z e = M a t h R o u n d ( s i z e / L o t S t e p ) * L o t S t e p ; 
       
       s t a t i c   b o o l   a l e r t _ m i n _ l o t s = f a l s e ; 
       i f   ( s i z e < M i n L o t s   & &   a l e r t _ m i n _ l o t s = = f a l s e )   { 
             a l e r t _ m i n _ l o t s = t r u e ; 
             A l e r t ( " Y o u   w a n t   t o   t r a d e   " , s i z e , "   l o t ,   b u t   y o u r   b r o k e r ' s   m i n i m u m   i s   " , M i n L o t s , "   l o t .   T h e   t r a d e / o r d e r   w i l l   c o n t i n u e   w i t h   " , M i n L o t s , "   l o t   i n s t e a d   o f   " , s i z e , "   l o t .   T h e   s a m e   r u l e   w i l l   b e   a p p l i e d   f o r   n e x t   t r a d e s / o r d e r s   w i t h   d e s i r e d   l o t   s i z e   l o w e r   t h a n   t h e   m i n i m u m .   Y o u   w i l l   n o t   s e e   t h i s   m e s s a g e   a g a i n   u n t i l   y o u   r e s t a r t   t h e   p r o g r a m . " ) ; 
       } 
       
       i f   ( a l i g n = = " a l i g n " )   { 
             i f   ( s i z e < M i n L o t s )   { s i z e = M i n L o t s ; } 
             i f   ( s i z e > M a x L o t s )   { s i z e = M a x L o t s ; } 
       } 
       
       r e t u r n   ( s i z e ) ; 
 }  
  
 s t r i n g   E r r o r M e s s a g e ( i n t   e r r o r _ c o d e = - 1 ) 
 { 
 	 s t r i n g   e   =   " " ; 
 	 
 	 i f   ( e r r o r _ c o d e   <   0 )   { e r r o r _ c o d e   =   G e t L a s t E r r o r ( ) ; } 
 	 
 	 s w i t c h ( e r r o r _ c o d e ) 
 	 { 
 	 	 / / - -   c o d e s   r e t u r n e d   f r o m   t r a d e   s e r v e r 
 	 	 c a s e   0 : 	 r e t u r n ( " " ) ; 
 	 	 c a s e   1 : 	 e   =   " N o   e r r o r   r e t u r n e d " ;   b r e a k ; 
 	 	 c a s e   2 : 	 e   =   " C o m m o n   e r r o r " ;   b r e a k ; 
 	 	 c a s e   3 : 	 e   =   " I n v a l i d   t r a d e   p a r a m e t e r s " ;   b r e a k ; 
 	 	 c a s e   4 : 	 e   =   " T r a d e   s e r v e r   i s   b u s y " ;   b r e a k ; 
 	 	 c a s e   5 : 	 e   =   " O l d   v e r s i o n   o f   t h e   c l i e n t   t e r m i n a l " ;   b r e a k ; 
 	 	 c a s e   6 : 	 e   =   " N o   c o n n e c t i o n   w i t h   t r a d e   s e r v e r " ;   b r e a k ; 
 	 	 c a s e   7 : 	 e   =   " N o t   e n o u g h   r i g h t s " ;   b r e a k ; 
 	 	 c a s e   8 : 	 e   =   " T o o   f r e q u e n t   r e q u e s t s " ;   b r e a k ; 
 	 	 c a s e   9 : 	 e   =   " M a l f u n c t i o n a l   t r a d e   o p e r a t i o n   ( n e v e r   r e t u r n e d   e r r o r ) " ;   b r e a k ; 
 	 	 c a s e   6 4 :     e   =   " A c c o u n t   d i s a b l e d " ;   b r e a k ; 
 	 	 c a s e   6 5 :     e   =   " I n v a l i d   a c c o u n t " ;   b r e a k ; 
 	 	 c a s e   1 2 8 :   e   =   " T r a d e   t i m e o u t " ;   b r e a k ; 
 	 	 c a s e   1 2 9 :   e   =   " I n v a l i d   p r i c e " ;   b r e a k ; 
 	 	 c a s e   1 3 0 :   e   =   " I n v a l i d   S l   o r   T P " ;   b r e a k ; 
 	 	 c a s e   1 3 1 :   e   =   " I n v a l i d   t r a d e   v o l u m e " ;   b r e a k ; 
 	 	 c a s e   1 3 2 :   e   =   " M a r k e t   i s   c l o s e d " ;   b r e a k ; 
 	 	 c a s e   1 3 3 :   e   =   " T r a d e   i s   d i s a b l e d " ;   b r e a k ; 
 	 	 c a s e   1 3 4 :   e   =   " N o t   e n o u g h   m o n e y " ;   b r e a k ; 
 	 	 c a s e   1 3 5 :   e   =   " P r i c e   c h a n g e d " ;   b r e a k ; 
 	 	 c a s e   1 3 6 :   e   =   " O f f   q u o t e s " ;   b r e a k ; 
 	 	 c a s e   1 3 7 :   e   =   " B r o k e r   i s   b u s y   ( n e v e r   r e t u r n e d   e r r o r ) " ;   b r e a k ; 
 	 	 c a s e   1 3 8 :   e   =   " R e q u o t e " ;   b r e a k ; 
 	 	 c a s e   1 3 9 :   e   =   " O r d e r   i s   l o c k e d " ;   b r e a k ; 
 	 	 c a s e   1 4 0 :   e   =   " O n l y   l o n g   t r a d e s   a l l o w e d " ;   b r e a k ; 
 	 	 c a s e   1 4 1 :   e   =   " T o o   m a n y   r e q u e s t s " ;   b r e a k ; 
 	 	 c a s e   1 4 5 :   e   =   " M o d i f i c a t i o n   d e n i e d   b e c a u s e   o r d e r   t o o   c l o s e   t o   m a r k e t " ;   b r e a k ; 
 	 	 c a s e   1 4 6 :   e   =   " T r a d e   c o n t e x t   i s   b u s y " ;   b r e a k ; 
 	 	 c a s e   1 4 7 :   e   =   " E x p i r a t i o n s   a r e   d e n i e d   b y   b r o k e r " ;   b r e a k ; 
 	 	 c a s e   1 4 8 :   e   =   " A m o u n t   o f   o p e n   a n d   p e n d i n g   o r d e r s   h a s   r e a c h e d   t h e   l i m i t " ;   b r e a k ; 
 	 	 c a s e   1 4 9 :   e   =   " H e d g i n g   i s   p r o h i b i t e d " ;   b r e a k ; 
 	 	 c a s e   1 5 0 :   e   =   " P r o h i b i t e d   b y   F I F O   r u l e s " ;   b r e a k ; 
 	 	 
 	 	 / / - -   m q l 4   e r r o r s 
 	 	 c a s e   4 0 0 0 :   e   =   " N o   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 0 0 1 :   e   =   " W r o n g   f u n c t i o n   p o i n t e r " ;   b r e a k ; 
 	 	 c a s e   4 0 0 2 :   e   =   " A r r a y   i n d e x   i s   o u t   o f   r a n g e " ;   b r e a k ; 
 	 	 c a s e   4 0 0 3 :   e   =   " N o   m e m o r y   f o r   f u n c t i o n   c a l l   s t a c k " ;   b r e a k ; 
 	 	 c a s e   4 0 0 4 :   e   =   " R e c u r s i v e   s t a c k   o v e r f l o w " ;   b r e a k ; 
 	 	 c a s e   4 0 0 5 :   e   =   " N o t   e n o u g h   s t a c k   f o r   p a r a m e t e r " ;   b r e a k ; 
 	 	 c a s e   4 0 0 6 :   e   =   " N o   m e m o r y   f o r   p a r a m e t e r   s t r i n g " ;   b r e a k ; 
 	 	 c a s e   4 0 0 7 :   e   =   " N o   m e m o r y   f o r   t e m p   s t r i n g " ;   b r e a k ; 
 	 	 c a s e   4 0 0 8 :   e   =   " N o t   i n i t i a l i z e d   s t r i n g " ;   b r e a k ; 
 	 	 c a s e   4 0 0 9 :   e   =   " N o t   i n i t i a l i z e d   s t r i n g   i n   a r r a y " ;   b r e a k ; 
 	 	 c a s e   4 0 1 0 :   e   =   " N o   m e m o r y   f o r   a r r a y   s t r i n g " ;   b r e a k ; 
 	 	 c a s e   4 0 1 1 :   e   =   " T o o   l o n g   s t r i n g " ;   b r e a k ; 
 	 	 c a s e   4 0 1 2 :   e   =   " R e m a i n d e r   f r o m   z e r o   d i v i d e " ;   b r e a k ; 
 	 	 c a s e   4 0 1 3 :   e   =   " Z e r o   d i v i d e " ;   b r e a k ; 
 	 	 c a s e   4 0 1 4 :   e   =   " U n k n o w n   c o m m a n d " ;   b r e a k ; 
 	 	 c a s e   4 0 1 5 :   e   =   " W r o n g   j u m p " ;   b r e a k ; 
 	 	 c a s e   4 0 1 6 :   e   =   " N o t   i n i t i a l i z e d   a r r a y " ;   b r e a k ; 
 	 	 c a s e   4 0 1 7 :   e   =   " d l l   c a l l s   a r e   n o t   a l l o w e d " ;   b r e a k ; 
 	 	 c a s e   4 0 1 8 :   e   =   " C a n n o t   l o a d   l i b r a r y " ;   b r e a k ; 
 	 	 c a s e   4 0 1 9 :   e   =   " C a n n o t   c a l l   f u n c t i o n " ;   b r e a k ; 
 	 	 c a s e   4 0 2 0 :   e   =   " E x p e r t   f u n c t i o n   c a l l s   a r e   n o t   a l l o w e d " ;   b r e a k ; 
 	 	 c a s e   4 0 2 1 :   e   =   " N o t   e n o u g h   m e m o r y   f o r   t e m p   s t r i n g   r e t u r n e d   f r o m   f u n c t i o n " ;   b r e a k ; 
 	 	 c a s e   4 0 2 2 :   e   =   " S y s t e m   i s   b u s y " ;   b r e a k ; 
 	 	 c a s e   4 0 5 0 :   e   =   " I n v a l i d   f u n c t i o n   p a r a m e t e r s   c o u n t " ;   b r e a k ; 
 	 	 c a s e   4 0 5 1 :   e   =   " I n v a l i d   f u n c t i o n   p a r a m e t e r   v a l u e " ;   b r e a k ; 
 	 	 c a s e   4 0 5 2 :   e   =   " S t r i n g   f u n c t i o n   i n t e r n a l   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 0 5 3 :   e   =   " S o m e   a r r a y   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 0 5 4 :   e   =   " I n c o r r e c t   s e r i e s   a r r a y   u s i n g " ;   b r e a k ; 
 	 	 c a s e   4 0 5 5 :   e   =   " C u s t o m   i n d i c a t o r   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 0 5 6 :   e   =   " A r r a y s   a r e   i n c o m p a t i b l e " ;   b r e a k ; 
 	 	 c a s e   4 0 5 7 :   e   =   " G l o b a l   v a r i a b l e s   p r o c e s s i n g   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 0 5 8 :   e   =   " G l o b a l   v a r i a b l e   n o t   f o u n d " ;   b r e a k ; 
 	 	 c a s e   4 0 5 9 :   e   =   " F u n c t i o n   i s   n o t   a l l o w e d   i n   t e s t i n g   m o d e " ;   b r e a k ; 
 	 	 c a s e   4 0 6 0 :   e   =   " F u n c t i o n   i s   n o t   c o n f i r m e d " ;   b r e a k ; 
 	 	 c a s e   4 0 6 1 :   e   =   " S e n d   m a i l   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 0 6 2 :   e   =   " S t r i n g   p a r a m e t e r   e x p e c t e d " ;   b r e a k ; 
 	 	 c a s e   4 0 6 3 :   e   =   " I n t e g e r   p a r a m e t e r   e x p e c t e d " ;   b r e a k ; 
 	 	 c a s e   4 0 6 4 :   e   =   " D o u b l e   p a r a m e t e r   e x p e c t e d " ;   b r e a k ; 
 	 	 c a s e   4 0 6 5 :   e   =   " A r r a y   a s   p a r a m e t e r   e x p e c t e d " ;   b r e a k ; 
 	 	 c a s e   4 0 6 6 :   e   =   " R e q u e s t e d   h i s t o r y   d a t a   i n   u p d a t e   s t a t e " ;   b r e a k ; 
 	 	 c a s e   4 0 9 9 :   e   =   " E n d   o f   f i l e " ;   b r e a k ; 
 	 	 c a s e   4 1 0 0 :   e   =   " S o m e   f i l e   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 1 0 1 :   e   =   " W r o n g   f i l e   n a m e " ;   b r e a k ; 
 	 	 c a s e   4 1 0 2 :   e   =   " T o o   m a n y   o p e n e d   f i l e s " ;   b r e a k ; 
 	 	 c a s e   4 1 0 3 :   e   =   " C a n n o t   o p e n   f i l e " ;   b r e a k ; 
 	 	 c a s e   4 1 0 4 :   e   =   " I n c o m p a t i b l e   a c c e s s   t o   a   f i l e " ;   b r e a k ; 
 	 	 c a s e   4 1 0 5 :   e   =   " N o   o r d e r   s e l e c t e d " ;   b r e a k ; 
 	 	 c a s e   4 1 0 6 :   e   =   " U n k n o w n   s y m b o l " ;   b r e a k ; 
 	 	 c a s e   4 1 0 7 :   e   =   " I n v a l i d   p r i c e   p a r a m e t e r   f o r   t r a d e   f u n c t i o n " ;   b r e a k ; 
 	 	 c a s e   4 1 0 8 :   e   =   " I n v a l i d   t i c k e t " ;   b r e a k ; 
 	 	 c a s e   4 1 0 9 :   e   =   " T r a d e   i s   n o t   a l l o w e d   i n   t h e   e x p e r t   p r o p e r t i e s " ;   b r e a k ; 
 	 	 c a s e   4 1 1 0 :   e   =   " L o n g s   a r e   n o t   a l l o w e d   i n   t h e   e x p e r t   p r o p e r t i e s " ;   b r e a k ; 
 	 	 c a s e   4 1 1 1 :   e   =   " S h o r t s   a r e   n o t   a l l o w e d   i n   t h e   e x p e r t   p r o p e r t i e s " ;   b r e a k ; 
 	 	 
 	 	 / / - -   o b j e c t s   e r r o r s 
 	 	 c a s e   4 2 0 0 :   e   =   " O b j e c t   i s   a l r e a d y   e x i s t " ;   b r e a k ; 
 	 	 c a s e   4 2 0 1 :   e   =   " U n k n o w n   o b j e c t   p r o p e r t y " ;   b r e a k ; 
 	 	 c a s e   4 2 0 2 :   e   =   " O b j e c t   i s   n o t   e x i s t " ;   b r e a k ; 
 	 	 c a s e   4 2 0 3 :   e   =   " U n k n o w n   o b j e c t   t y p e " ;   b r e a k ; 
 	 	 c a s e   4 2 0 4 :   e   =   " N o   o b j e c t   n a m e " ;   b r e a k ; 
 	 	 c a s e   4 2 0 5 :   e   =   " O b j e c t   c o o r d i n a t e s   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 2 0 6 :   e   =   " N o   s p e c i f i e d   s u b w i n d o w " ;   b r e a k ; 
 	 	 c a s e   4 2 0 7 :   e   =   " G r a p h i c a l   o b j e c t   e r r o r " ;   b r e a k ;     
 	 	 c a s e   4 2 1 0 :   e   =   " U n k n o w n   c h a r t   p r o p e r t y " ;   b r e a k ; 
 	 	 c a s e   4 2 1 1 :   e   =   " C h a r t   n o t   f o u n d " ;   b r e a k ; 
 	 	 c a s e   4 2 1 2 :   e   =   " C h a r t   s u b w i n d o w   n o t   f o u n d " ;   b r e a k ; 
 	 	 c a s e   4 2 1 3 :   e   =   " C h a r t   i n d i c a t o r   n o t   f o u n d " ;   b r e a k ; 
 	 	 c a s e   4 2 2 0 :   e   =   " S y m b o l   s e l e c t   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 2 5 0 :   e   =   " N o t i f i c a t i o n   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 2 5 1 :   e   =   " N o t i f i c a t i o n   p a r a m e t e r   e r r o r " ;   b r e a k ; 
 	 	 c a s e   4 2 5 2 :   e   =   " N o t i f i c a t i o n s   d i s a b l e d " ;   b r e a k ; 
 	 	 c a s e   4 2 5 3 :   e   =   " N o t i f i c a t i o n   s e n d   t o o   f r e q u e n t " ;   b r e a k ; 
 	 	 
 	 	 / / - -   f t p   e r r o r s 
 	 	 c a s e   4 2 6 0 :   e   =   " F T P   s e r v e r   i s   n o t   s p e c i f i e d " ;   b r e a k ; 
 	 	 c a s e   4 2 6 1 :   e   =   " F T P   l o g i n   i s   n o t   s p e c i f i e d " ;   b r e a k ; 
 	 	 c a s e   4 2 6 2 :   e   =   " F T P   c o n n e c t i o n   f a i l e d " ;   b r e a k ; 
 	 	 c a s e   4 2 6 3 :   e   =   " F T P   c o n n e c t i o n   c l o s e d " ;   b r e a k ; 
 	 	 c a s e   4 2 6 4 :   e   =   " F T P   p a t h   n o t   f o u n d   o n   s e r v e r " ;   b r e a k ; 
 	 	 c a s e   4 2 6 5 :   e   =   " F i l e   n o t   f o u n d   i n   t h e   M Q L 4 \ \ F i l e s   d i r e c t o r y   t o   s e n d   o n   F T P   s e r v e r " ;   b r e a k ; 
 	 	 c a s e   4 2 6 6 :   e   =   " C o m m o n   e r r o r   d u r i n g   F T P   d a t a   t r a n s m i s s i o n " ;   b r e a k ; 
 	 	 
 	 	 / / - -   f i l e s y s t e m   e r r o r s 
 	 	 c a s e   5 0 0 1 :   e   =   " T o o   m a n y   o p e n e d   f i l e s " ;   b r e a k ; 
 	 	 c a s e   5 0 0 2 :   e   =   " W r o n g   f i l e   n a m e " ;   b r e a k ; 
 	 	 c a s e   5 0 0 3 :   e   =   " T o o   l o n g   f i l e   n a m e " ;   b r e a k ; 
 	 	 c a s e   5 0 0 4 :   e   =   " C a n n o t   o p e n   f i l e " ;   b r e a k ; 
 	 	 c a s e   5 0 0 5 :   e   =   " T e x t   f i l e   b u f f e r   a l l o c a t i o n   e r r o r " ;   b r e a k ; 
 	 	 c a s e   5 0 0 6 :   e   =   " C a n n o t   d e l e t e   f i l e " ;   b r e a k ; 
 	 	 c a s e   5 0 0 7 :   e   =   " I n v a l i d   f i l e   h a n d l e   ( f i l e   c l o s e d   o r   w a s   n o t   o p e n e d ) " ;   b r e a k ; 
 	 	 c a s e   5 0 0 8 :   e   =   " W r o n g   f i l e   h a n d l e   ( h a n d l e   i n d e x   i s   o u t   o f   h a n d l e   t a b l e ) " ;   b r e a k ; 
 	 	 c a s e   5 0 0 9 :   e   =   " F i l e   m u s t   b e   o p e n e d   w i t h   F I L E _ W R I T E   f l a g " ;   b r e a k ; 
 	 	 c a s e   5 0 1 0 :   e   =   " F i l e   m u s t   b e   o p e n e d   w i t h   F I L E _ R E A D   f l a g " ;   b r e a k ; 
 	 	 c a s e   5 0 1 1 :   e   =   " F i l e   m u s t   b e   o p e n e d   w i t h   F I L E _ B I N   f l a g " ;   b r e a k ; 
 	 	 c a s e   5 0 1 2 :   e   =   " F i l e   m u s t   b e   o p e n e d   w i t h   F I L E _ T X T   f l a g " ;   b r e a k ; 
 	 	 c a s e   5 0 1 3 :   e   =   " F i l e   m u s t   b e   o p e n e d   w i t h   F I L E _ T X T   o r   F I L E _ C S V   f l a g " ;   b r e a k ; 
 	 	 c a s e   5 0 1 4 :   e   =   " F i l e   m u s t   b e   o p e n e d   w i t h   F I L E _ C S V   f l a g " ;   b r e a k ; 
 	 	 c a s e   5 0 1 5 :   e   =   " F i l e   r e a d   e r r o r " ;   b r e a k ; 
 	 	 c a s e   5 0 1 6 :   e   =   " F i l e   w r i t e   e r r o r " ;   b r e a k ; 
 	 	 c a s e   5 0 1 7 :   e   =   " S t r i n g   s i z e   m u s t   b e   s p e c i f i e d   f o r   b i n a r y   f i l e " ;   b r e a k ; 
 	 	 c a s e   5 0 1 8 :   e   =   " I n c o m p a t i b l e   f i l e   ( f o r   s t r i n g   a r r a y s - T X T ,   f o r   o t h e r s - B I N ) " ;   b r e a k ; 
 	 	 c a s e   5 0 1 9 :   e   =   " F i l e   i s   d i r e c t o r y ,   n o t   f i l e " ;   b r e a k ; 
 	 	 c a s e   5 0 2 0 :   e   =   " F i l e   d o e s   n o t   e x i s t " ;   b r e a k ; 
 	 	 c a s e   5 0 2 1 :   e   =   " F i l e   c a n n o t   b e   r e w r i t t e n " ;   b r e a k ; 
 	 	 c a s e   5 0 2 2 :   e   =   " W r o n g   d i r e c t o r y   n a m e " ;   b r e a k ; 
 	 	 c a s e   5 0 2 3 :   e   =   " D i r e c t o r y   d o e s   n o t   e x i s t " ;   b r e a k ; 
 	 	 c a s e   5 0 2 4 :   e   =   " S p e c i f i e d   f i l e   i s   n o t   d i r e c t o r y " ;   b r e a k ; 
 	 	 c a s e   5 0 2 5 :   e   =   " C a n n o t   d e l e t e   d i r e c t o r y " ;   b r e a k ; 
 	 	 c a s e   5 0 2 6 :   e   =   " C a n n o t   c l e a n   d i r e c t o r y " ;   b r e a k ; 
 	 	 
 	 	 / / - -   o t h e r   e r r o r s 
 	 	 c a s e   5 0 2 7 :   e   =   " A r r a y   r e s i z e   e r r o r " ;   b r e a k ; 
 	 	 c a s e   5 0 2 8 :   e   =   " S t r i n g   r e s i z e   e r r o r " ;   b r e a k ; 
 	 	 c a s e   5 0 2 9 :   e   =   " S t r u c t u r e   c o n t a i n s   s t r i n g s   o r   d y n a m i c   a r r a y s " ;   b r e a k ; 
 	 	 
 	 	 / / - -   h t t p   r e q u e s t 
 	 	 c a s e   5 2 0 0 :   e   =   " I n v a l i d   U R L " ;   b r e a k ; 
 	 	 c a s e   5 2 0 1 :   e   =   " F a i l e d   t o   c o n n e c t   t o   s p e c i f i e d   U R L " ;   b r e a k ; 
 	 	 c a s e   5 2 0 2 :   e   =   " T i m e o u t   e x c e e d e d " ;   b r e a k ; 
 	 	 c a s e   5 2 0 3 :   e   =   " H T T P   r e q u e s t   f a i l e d " ;   b r e a k ; 
 
 	 	 d e f a u l t : 	 e   =   " U n k n o w n   e r r o r " ; 
 	 } 
 
 	 e   =   S t r i n g C o n c a t e n a t e ( e ,   "   ( " ,   e r r o r _ c o d e ,   " ) " ) ; 
 	 
 	 r e t u r n   e ; 
 }  
  
 d a t e t i m e   E x p i r a t i o n T i m e ( s t r i n g   m o d e = " G T C " , i n t   d a y s = 0 ,   i n t   h o u r s = 0 ,   i n t   m i n u t e s = 0 ,   d a t e t i m e   c u s t o m = 0 ) 
 { 
 	 d a t e t i m e   n o w                 =   T i m e C u r r e n t ( ) ; 
       d a t e t i m e   e x p i r a t i o n   =   n o w ; 
 
 	           i f   ( m o d e   = =   " G T C "   | |   m o d e   = =   " " )   { e x p i r a t i o n   =   0 ; } 
 	 e l s e   i f   ( m o d e   = =   " t o d a y " )                           { e x p i r a t i o n   =   ( d a t e t i m e ) ( M a t h F l o o r ( ( n o w   +   8 6 4 0 0 . 0 )   /   8 6 4 0 0 . 0 )   *   8 6 4 0 0 . 0 ) ; } 
 	 e l s e   i f   ( m o d e   = =   " s p e c i f i e d " ) 
 	 { 
 	 	 e x p i r a t i o n   =   0 ; 
 
 	 	 i f   ( ( d a y s   +   h o u r s   +   m i n u t e s )   >   0 ) 
 	 	 { 
 	 	 	 e x p i r a t i o n   =   n o w   +   ( 8 6 4 0 0   *   d a y s )   +   ( 3 6 0 0   *   h o u r s )   +   ( 6 0   *   m i n u t e s ) ; 
 	 	 } 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( c u s t o m   < =   n o w ) 
 	 	 { 
 	 	 	 i f   ( c u s t o m   <   3 1 5 5 7 6 0 0 ) 
 	 	 	 { 
 	 	 	 	 c u s t o m   =   n o w   +   c u s t o m ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 c u s t o m   =   0 ; 
 	 	 	 } 
 	 	 } 
 
 	 	 e x p i r a t i o n   =   c u s t o m ; 
 	 } 
 
 	 r e t u r n   e x p i r a t i o n ; 
 }  
  
 c l a s s   E x p i r a t i o n W o r k e r 
 { 
 p r i v a t e : 
 	 s t r u c t   C a c h e d I t e m s 
 	 { 
 	 	 l o n g   t i c k e t ; 
 	 	 d a t e t i m e   e x p i r a t i o n ; 
 	 } ; 
 
 	 C a c h e d I t e m s   c a c h e d I t e m s [ ] ; 
 	 l o n g   c h a r t I D ; 
 	 s t r i n g   c h a r t O b j e c t P r e f i x ; 
 	 s t r i n g   c h a r t O b j e c t S u f f i x ; 
 
 	 t e m p l a t e < t y p e n a m e   T > 
 	 v o i d   A r r a y C l o n e ( T   & d e s t [ ] ,   T   & s r c [ ] ) 
 	 { 
 	 	 i n t   s i z e   =   A r r a y S i z e ( s r c ) ; 
 	 	 A r r a y R e s i z e ( d e s t ,   s i z e ) ; 
 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 	 { 
 	 	 	 d e s t [ i ]   =   s r c [ i ] ; 
 	 	 } 
 	 } 
 
 	 v o i d   I n i t i a l D i s c o v e r y ( ) 
 	 { 
 	 	 A r r a y R e s i z e ( c a c h e d I t e m s ,   0 ) ; 
 
 	 	 i n t   t o t a l   =   O r d e r s T o t a l ( ) ; 
 
 	 	 f o r   ( i n t   i n d e x   =   0 ;   i n d e x   < =   t o t a l ;   i n d e x + + ) 
 	 	 { 
 	 	 	 l o n g   t i c k e t   =   G e t T i c k e t B y I n d e x ( i n d e x ) ; 
 
 	 	 	 i f   ( t i c k e t   = =   0 )   c o n t i n u e ; 
 
 	 	 	 d a t e t i m e   e x p i r a t i o n   =   G e t E x p i r a t i o n F r o m O b j e c t ( t i c k e t ) ; 
 
 	 	 	 i f   ( e x p i r a t i o n   >   0 ) 
 	 	 	 { 
 	 	 	 	 S e t E x p i r a t i o n I n C a c h e ( t i c k e t ,   e x p i r a t i o n ) ; 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 l o n g   G e t T i c k e t B y I n d e x ( i n t   i n d e x ) 
 	 { 
 	 	 l o n g   t i c k e t   =   0 ; 
 
 	 	 i f   ( O r d e r S e l e c t ( i n d e x ,   S E L E C T _ B Y _ P O S ,   M O D E _ T R A D E S ) ) 
 	 	 { 
 	 	 	 i f   ( O r d e r T y p e ( )   < =   O P _ S E L L )   t i c k e t   =   ( l o n g ) O r d e r T i c k e t ( ) ; 
 	 	 } 
 
 	 	 r e t u r n   t i c k e t ; 
 	 } 
 
 	 d a t e t i m e   G e t E x p i r a t i o n F r o m O b j e c t ( l o n g   t i c k e t ) 
 	 { 
 	 	 d a t e t i m e   e x p i r a t i o n   =   ( d a t e t i m e ) 0 ; 
 	 	 
 	 	 s t r i n g   o b j e c t N a m e   =   c h a r t O b j e c t P r e f i x   +   I n t e g e r T o S t r i n g ( t i c k e t )   +   c h a r t O b j e c t S u f f i x ; 
 
 	 	 i f   ( O b j e c t F i n d ( c h a r t I D ,   o b j e c t N a m e )   = =   c h a r t I D ) 
 	 	 { 
 	 	 	 e x p i r a t i o n   =   ( d a t e t i m e ) O b j e c t G e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ T I M E ) ; 
 	 	 } 
 
 	 	 r e t u r n   e x p i r a t i o n ; 
 	 } 
 
 	 b o o l   R e m o v e E x p i r a t i o n O b j e c t ( l o n g   t i c k e t ) 
 	 { 
 	 	 b o o l   s u c c e s s             =   f a l s e ; 
 	 	 s t r i n g   o b j e c t N a m e   =   " " ; 
 
 	 	 o b j e c t N a m e   =   c h a r t O b j e c t P r e f i x   +   I n t e g e r T o S t r i n g ( t i c k e t )   +   c h a r t O b j e c t S u f f i x ; 
 	 	 s u c c e s s         =   O b j e c t D e l e t e ( c h a r t I D ,   o b j e c t N a m e ) ; 
 
 	 	 r e t u r n   s u c c e s s ; 
 	 } 
 
 	 v o i d   R e m o v e E x p i r a t i o n F r o m C a c h e ( l o n g   t i c k e t ) 
 	 { 
 	 	 i n t   s i z e   =   A r r a y S i z e ( c a c h e d I t e m s ) ; 
 	 	 C a c h e d I t e m s   n e w I t e m s [ ] ; 
 	 	 i n t   n e w S i z e   =   0 ; 
 	 	 b o o l   i t e m R e m o v e d   =   f a l s e ; 
 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 	 { 
 	 	 	 i f   ( c a c h e d I t e m s [ i ] . t i c k e t   = =   t i c k e t ) 
 	 	 	 { 
 	 	 	 	 i t e m R e m o v e d   =   t r u e ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 n e w S i z e + + ; 
 	 	 	 	 A r r a y R e s i z e ( n e w I t e m s ,   n e w S i z e ) ; 
 	 	 	 	 n e w I t e m s [ n e w S i z e   -   1 ] . t i c k e t           =   c a c h e d I t e m s [ i ] . t i c k e t ; 
 	 	 	 	 n e w I t e m s [ n e w S i z e   -   1 ] . e x p i r a t i o n   =   c a c h e d I t e m s [ i ] . e x p i r a t i o n ; 
 	 	 	 } 
 	 	 } 
 
 	 	 i f   ( i t e m R e m o v e d )   A r r a y C l o n e ( c a c h e d I t e m s ,   n e w I t e m s ) ; 
 	 } 
 
 	 v o i d   S e t E x p i r a t i o n I n C a c h e ( l o n g   t i c k e t ,   d a t e t i m e   e x p i r a t i o n ) 
 	 { 
 	 	 b o o l   a l r e a d y E x i s t s   =   f a l s e ; 
 	 	 i n t   s i z e                       =   A r r a y S i z e ( c a c h e d I t e m s ) ; 
 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 	 { 
 	 	 	 i f   ( c a c h e d I t e m s [ i ] . t i c k e t   = =   t i c k e t ) 
 	 	 	 { 
 	 	 	 	 c a c h e d I t e m s [ i ] . e x p i r a t i o n   =   e x p i r a t i o n ; 
 	 	 	 	 a l r e a d y E x i s t s   =   t r u e ; 
 	 	 	 	 b r e a k ; 
 	 	 	 } 
 	 	 } 
 
 	 	 i f   ( a l r e a d y E x i s t s   = =   f a l s e ) 
 	 	 { 
 	 	 	 A r r a y R e s i z e ( c a c h e d I t e m s ,   s i z e   +   1 ) ; 
 	 	 	 c a c h e d I t e m s [ s i z e ] . t i c k e t           =   t i c k e t ; 
 	 	 	 c a c h e d I t e m s [ s i z e ] . e x p i r a t i o n   =   e x p i r a t i o n ; 
 	 	 } 
 	 } 
 
 	 b o o l   S e t E x p i r a t i o n I n O b j e c t ( l o n g   t i c k e t ,   d a t e t i m e   e x p i r a t i o n ) 
 	 { 
 	 	 i f   ( ! O r d e r S e l e c t ( ( i n t ) t i c k e t ,   S E L E C T _ B Y _ T I C K E T ) )   r e t u r n   f a l s e ; 
 
 	 	 s t r i n g   o b j e c t N a m e   =   c h a r t O b j e c t P r e f i x   +   I n t e g e r T o S t r i n g ( t i c k e t )   +   c h a r t O b j e c t S u f f i x ; 
 	 	 d o u b l e   p r i c e             =   O r d e r O p e n P r i c e ( ) ; 
 
 	 	 i f   ( O b j e c t F i n d ( c h a r t I D ,   o b j e c t N a m e )   = =   c h a r t I D ) 
 	 	 { 
 	 	 	 O b j e c t S e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ T I M E ,   e x p i r a t i o n ) ; 
 	 	 	 O b j e c t S e t D o u b l e ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ P R I C E ,   p r i c e ) ; 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 O b j e c t C r e a t e ( c h a r t I D ,   o b j e c t N a m e ,   O B J _ A R R O W ,   0 ,   e x p i r a t i o n ,   p r i c e ) ; 
 	 	 } 
 
 	 	 O b j e c t S e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ A R R O W C O D E ,   7 7 ) ; 
 	 	 O b j e c t S e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ H I D D E N ,   t r u e ) ; 
 	 	 O b j e c t S e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ A N C H O R ,   A N C H O R _ T O P ) ; 
 	 	 O b j e c t S e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ C O L O R ,   c l r R e d ) ; 
 	 	 O b j e c t S e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ S E L E C T A B L E ,   f a l s e ) ; 
 	 	 O b j e c t S e t I n t e g e r ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ T I M E F R A M E S ,   O B J _ N O _ P E R I O D S ) ; 
 	 	 O b j e c t S e t S t r i n g ( c h a r t I D ,   o b j e c t N a m e ,   O B J P R O P _ T E X T ,   T i m e T o S t r i n g ( e x p i r a t i o n ) ) ; 
 
 	 	 r e t u r n   t r u e ; 
 	 } 
 	 
 	 b o o l   T r a d e E x i s t s ( l o n g   t i c k e t ) 
 	 { 
 	 	 b o o l   e x i s t s     =   f a l s e ; 
 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   O r d e r s T o t a l ( ) ;   i + + ) 
 	 	 { 
 	 	 	 i f   ( ! O r d e r S e l e c t ( i ,   S E L E C T _ B Y _ P O S ,   M O D E _ T R A D E S ) )   c o n t i n u e ; 
 
 	 	 	 i f   ( O r d e r T i c k e t ( )   = =   t i c k e t ) 
 	 	 	 { 
 	 	 	 	 e x i s t s   =   t r u e ; 
 	 	 	 	 b r e a k ; 
 	 	 	 } 
 	 	 } 
 
 	 	 r e t u r n   e x i s t s ; 
 	 } 
 
 p u b l i c : 
 	 / /   D e f a u l t   c o n s t r u c t o r 
 	 E x p i r a t i o n W o r k e r ( ) 
 	 { 
 	 	 c h a r t I D                       =   0 ; 
 	 	 c h a r t O b j e c t P r e f i x   =   " # " ; 
 	 	 c h a r t O b j e c t S u f f i x   =   "   E x p i r a t i o n   M a r k e r " ; 
 
 	 	 I n i t i a l D i s c o v e r y ( ) ; 
 	 } 
 
 	 v o i d   S e t E x p i r a t i o n ( l o n g   t i c k e t ,   d a t e t i m e   e x p i r a t i o n ) 
 	 { 
 	 	 i f   ( e x p i r a t i o n   < =   0 ) 
 	 	 { 
 	 	 	 R e m o v e E x p i r a t i o n ( t i c k e t ) ; 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 S e t E x p i r a t i o n I n O b j e c t ( t i c k e t ,   e x p i r a t i o n ) ; 
 	 	 	 S e t E x p i r a t i o n I n C a c h e ( t i c k e t ,   e x p i r a t i o n ) ; 
 	 	 } 
 	 } 
 
 	 d a t e t i m e   G e t E x p i r a t i o n ( l o n g   t i c k e t ) 
 	 { 
 	 	 d a t e t i m e   e x p i r a t i o n   =   ( d a t e t i m e ) 0 ; 
 	 	 i n t   s i z e                         =   A r r a y S i z e ( c a c h e d I t e m s ) ; 
 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 	 { 
 	 	 	 i f   ( c a c h e d I t e m s [ i ] . t i c k e t   = =   t i c k e t ) 
 	 	 	 { 
 	 	 	 	 e x p i r a t i o n   =   c a c h e d I t e m s [ i ] . e x p i r a t i o n ; 
 	 	 	 	 b r e a k ; 
 	 	 	 } 
 	 	 } 
 
 	 	 r e t u r n   e x p i r a t i o n ; 
 	 } 
 
 	 v o i d   R e m o v e E x p i r a t i o n ( l o n g   t i c k e t ) 
 	 { 
 	 	 R e m o v e E x p i r a t i o n O b j e c t ( t i c k e t ) ; 
 	 	 R e m o v e E x p i r a t i o n F r o m C a c h e ( t i c k e t ) ; 
 	 } 
 
 	 v o i d   R u n ( ) 
 	 { 
 	 	 i n t   c o u n t   =   A r r a y S i z e ( c a c h e d I t e m s ) ; 
 
 	 	 i f   ( c o u n t   >   0 ) 
 	 	 { 
 	 	 	 d a t e t i m e   t i m e N o w   =   T i m e C u r r e n t ( ) ; 
 
 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   c o u n t ;   i + + ) 
 	 	 	 { 
 	 	 	 	 i f   ( t i m e N o w   > =   c a c h e d I t e m s [ i ] . e x p i r a t i o n ) 
 	 	 	 	 { 
 	 	 	 	 	 l o n g   t i c k e t                       =   c a c h e d I t e m s [ i ] . t i c k e t ; 
 	 	 	 	 	 b o o l   r e m o v e E x p i r a t i o n   =   f a l s e ; 
 
 	 	 	 	 	 i f   ( T r a d e E x i s t s ( t i c k e t ) ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 i f   ( C l o s e T r a d e ( t i c k e t ) ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 P r i n t ( " c l o s e   # " ,   t i c k e t ,   "   b y   e x p i r a t i o n " ) ; 
 	 	 	 	 	 	 	 r e m o v e E x p i r a t i o n   =   t r u e ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 	 e l s e 
 	 	 	 	 	 { 
 	 	 	 	 	 	 r e m o v e E x p i r a t i o n   =   t r u e ; 
 	 	 	 	 	 } 
 
 	 	 	 	 	 i f   ( r e m o v e E x p i r a t i o n ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 R e m o v e E x p i r a t i o n ( t i c k e t ) ; 
 
 	 	 	 	 	 	 / /   R e m o v i n g   e x p i r a t i o n   c a u s e s   c h a n g e   i n   t h e   s i z e   o f   t h e   c a c h e , 
 	 	 	 	 	 	 / /   s o   r e s e t   o f   t h e   s i z e   a n d   o n e   s t e p   b a c k   o f   t h e   i n d e x   i s   n e e d e d 
 	 	 	 	 	 	 c o u n t   =   A r r a y S i z e ( c a c h e d I t e m s ) ; 
 	 	 	 	 	 	 i - - ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 } 
 } ; 
 
 E x p i r a t i o n W o r k e r   e x p i r a t i o n W o r k e r ;  
  
 b o o l   F i l t e r O r d e r B y ( 
 	 s t r i n g   g r o u p _ m o d e         =   " a l l " , 
 	 s t r i n g   g r o u p                   =   " 0 " , 
 	 s t r i n g   m a r k e t _ m o d e       =   " a l l " , 
 	 s t r i n g   m a r k e t                 =   " " , 
 	 s t r i n g   B u y s O r S e l l s       =   " b o t h " , 
 	 s t r i n g   L i m i t s O r S t o p s   =   " b o t h " , 
 	 i n t   T r a d e s O r d e r s           =   0 , 
 	 b o o l   o n T r a d e                   =   f a l s e 
 )   { 
 	 / /   T r a d e s O r d e r s   =   0   -   t r a d e s   o n l y 
 	 / /   T r a d e s O r d e r s   =   1   -   o r d e r s   o n l y 
 	 / /   T r a d e s O r d e r s   =   2   -   t r a d e s   a n d   o r d e r s 
 
 	 / / - -   d b 
 	 s t a t i c   s t r i n g   m a r k e t s [ ] ; 
 	 s t a t i c   s t r i n g   m a r k e t 0       =   " - " ; 
 	 s t a t i c   i n t   m a r k e t s _ s i z e   =   0 ; 
 	 
 	 s t a t i c   s t r i n g   g r o u p s [ ] ; 
 	 s t a t i c   s t r i n g   g r o u p 0       =   " - " ; 
 	 s t a t i c   i n t   g r o u p s _ s i z e   =   0 ; 
 	 
 	 / / - -   l o c a l   v a r i a b l e s 
 	 b o o l   t y p e _ p a s s       =   f a l s e ; 
 	 b o o l   m a r k e t _ p a s s   =   f a l s e ; 
 	 b o o l   g r o u p _ p a s s     =   f a l s e ; 
 	 
 	 i n t   i ,   t y p e ,   m a g i c _ n u m b e r ; 
 	 s t r i n g   s y m b o l ; 
 
 	 / /   T r a d e s 
 	 i f   ( o n T r a d e   = =   f a l s e ) 
 	 { 
 	 	 t y p e                   =   O r d e r T y p e ( ) ; 
 	 	 m a g i c _ n u m b e r   =   O r d e r M a g i c N u m b e r ( ) ; 
 	 	 s y m b o l               =   O r d e r S y m b o l ( ) ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 t y p e                   =   e _ a t t r T y p e ( ) ; 
 	 	 m a g i c _ n u m b e r   =   e _ a t t r M a g i c N u m b e r ( ) ; 
 	 	 s y m b o l               =   e _ a t t r S y m b o l ( ) ; 
 	 } 
 
 	 i f   ( T r a d e s O r d e r s   = =   0 ) 
 	 { 
 	 	 i f   ( 
 	 	 	 	 ( B u y s O r S e l l s   = =   " b o t h "     & &   ( t y p e   = =   O P _ B U Y   | |   t y p e   = =   O P _ S E L L ) ) 
 	 	 	 | |   ( B u y s O r S e l l s   = =   " b u y s "     & &   t y p e   = =   O P _ B U Y ) 
 	 	 	 | |   ( B u y s O r S e l l s   = =   " s e l l s "   & &   t y p e   = =   O P _ S E L L ) 
 	 	 	 
 	 	 	 ) 
 	 	 { 
 	 	 	 t y p e _ p a s s   =   t r u e ; 
 	 	 } 
 	 } 
 	 / /   P e n d i n g   o r d e r s 
 	 e l s e   i f   ( T r a d e s O r d e r s   = =   1 ) 
 	 { 
 	 	 i f   ( 
 	 	 	 	 ( B u y s O r S e l l s   = =   " b o t h "   & &   ( t y p e   = =   O P _ B U Y L I M I T   | |   t y p e   = =   O P _ B U Y S T O P   | |   t y p e   = =   O P _ S E L L L I M I T   | |   t y p e   = =   O P _ S E L L S T O P ) ) 
 	 	 	 | | 	 ( B u y s O r S e l l s   = =   " b u y s "   & &   ( t y p e   = =   O P _ B U Y L I M I T   | |   t y p e   = =   O P _ B U Y S T O P ) ) 
 	 	 	 | |   ( B u y s O r S e l l s   = =   " s e l l s "   & &   ( t y p e   = =   O P _ S E L L L I M I T   | |   t y p e   = =   O P _ S E L L S T O P ) ) 
 	 	 	 ) 
 	 	 { 
 	 	 	 i f   ( 
 	 	 	 	 	 ( L i m i t s O r S t o p s   = =   " b o t h "   & &   ( t y p e   = =   O P _ B U Y S T O P   | |   t y p e   = =   O P _ S E L L S T O P   | |   t y p e   = =   O P _ B U Y L I M I T   | |   t y p e   = =   O P _ S E L L L I M I T ) ) 
 	 	 	 	 | | 	 ( L i m i t s O r S t o p s   = =   " s t o p s "   & &   ( t y p e   = =   O P _ B U Y S T O P   | |   t y p e   = =   O P _ S E L L S T O P ) ) 
 	 	 	 	 | |   ( L i m i t s O r S t o p s   = =   " l i m i t s "   & &   ( t y p e   = =   O P _ B U Y L I M I T   | |   t y p e   = =   O P _ S E L L L I M I T ) ) 	 	 	 	 	 
 	 	 	 	 ) 
 	 	 	 { 
 	 	 	 	 t y p e _ p a s s   =   t r u e ; 
 	 	 	 } 
 	 	 } 
 	 } 
 	 / / - -   T r a d e s   a n d   o r d e r s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 e l s e 
 	 { 
 	 	 i f   ( 
 	 	 	 	 ( B u y s O r S e l l s   = =   " b o t h " ) 
 	 	 	 | |   ( B u y s O r S e l l s   = =   " b u y s "     & &   ( t y p e   = =   O P _ B U Y   | |   t y p e   = =   O P _ B U Y L I M I T   | |   t y p e   = =   O P _ B U Y S T O P ) ) 
 	 	 	 | |   ( B u y s O r S e l l s   = =   " s e l l s "   & &   ( t y p e   = =   O P _ S E L L   | |   t y p e   = =   O P _ S E L L L I M I T   | |   t y p e   = =   O P _ S E L L S T O P ) ) 
 	 	 	 ) 
 	 	 { 
 	 	 	 t y p e _ p a s s   =   t r u e ; 
 	 	 } 
 	 } 
 
 	 i f   ( t y p e _ p a s s   = =   f a l s e ) 
 	 { 
 	 	 r e t u r n   f a l s e ; 
 	 } 
 
 	 / / - -   c h e c k   g r o u p 
 	 i f   ( g r o u p _ m o d e   = =   " g r o u p " ) 
 	 { 
 	 	 i f   ( g r o u p   = =   " " ) 
 	 	 { 
 	 	 	 i f   ( m a g i c _ n u m b e r   = =   M a g i c S t a r t ) 
       	 	 { 
       	 	 	 g r o u p _ p a s s   =   t r u e ; 
       	 	 } 
 	       } 
 	       e l s e 
 	       { 
 	 	 	 i f   ( g r o u p 0   ! =   g r o u p ) 
 	 	 	 { 
 	 	 	 	 g r o u p 0   =   g r o u p ; 
 	 	 	 	 S t r i n g E x p l o d e ( " , " ,   g r o u p , g r o u p s ) ; 
 	 	 	 	 g r o u p s _ s i z e   =   A r r a y S i z e ( g r o u p s ) ; 
 
 	 	 	 	 f o r ( i   =   0 ;   i   <   g r o u p s _ s i z e ;   i + + ) 
 	 	 	 	 { 
 	 	 	 	 	 g r o u p s [ i ]   =   S t r i n g T r i m R i g h t ( g r o u p s [ i ] ) ; 
 	 	 	 	 	 g r o u p s [ i ]   =   S t r i n g T r i m L e f t ( g r o u p s [ i ] ) ; 
 
 	 	 	 	 	 i f   ( g r o u p s [ i ]   = =   " " )   { g r o u p s [ i ]   =   " 0 " ; } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 
 	 	 	 f o r ( i   =   0 ;   i   <   g r o u p s _ s i z e ;   i + + ) 
 	 	 	 { 
 	 	 	 	 i f   ( m a g i c _ n u m b e r   = =   ( M a g i c S t a r t + ( i n t ) g r o u p s [ i ] ) ) 
 	 	 	 	 { 
 	 	 	 	 	 g r o u p _ p a s s   =   t r u e ; 
 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 } 
 	 e l s e   i f   ( g r o u p _ m o d e   = =   " a l l "   | |   ( g r o u p _ m o d e   = =   " m a n u a l "   & &   m a g i c _ n u m b e r   = =   0 ) ) 
 	 { 
 	 	 g r o u p _ p a s s   =   t r u e ;     
 	 } 
 
 	 i f   ( g r o u p _ p a s s   = =   f a l s e ) 
 	 { 
 	 	 r e t u r n   f a l s e ; 
 	 } 
 
 	 / /   c h e c k   m a r k e t 
 	 i f   ( m a r k e t _ m o d e   = =   " a l l " ) 
 	 { 
 	 	 m a r k e t _ p a s s   =   t r u e ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( s y m b o l   = =   m a r k e t ) 
 	       { 
 	             m a r k e t _ p a s s   =   t r u e ; 
 	       } 
             e l s e 
             { 
 	 	 	 i f   ( m a r k e t 0   ! =   m a r k e t ) 
 	 	 	 { 
 	 	 	 	 m a r k e t 0   =   m a r k e t ; 
 
 	 	 	 	 i f   ( m a r k e t   = =   " " ) 
 	 	 	 	 { 
 	 	 	 	 	 m a r k e t s _ s i z e   =   1 ; 
 	 	 	 	 	 A r r a y R e s i z e ( m a r k e t s ,   1 ) ; 
 	 	 	 	 	 m a r k e t s [ 0 ]   =   S y m b o l ( ) ; 
 	 	 	 	 } 
 	 	 	 	 e l s e 
 	 	 	 	 { 
 	 	 	 	 	 S t r i n g E x p l o d e ( " , " ,   m a r k e t ,   m a r k e t s ) ; 
 	 	 	 	 	 m a r k e t s _ s i z e   =   A r r a y S i z e ( m a r k e t s ) ; 
 
 	 	 	 	 	 f o r ( i   =   0 ;   i   <   m a r k e t s _ s i z e ;   i + + ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 m a r k e t s [ i ]   =   S t r i n g T r i m R i g h t ( m a r k e t s [ i ] ) ; 
 	 	 	 	 	 	 m a r k e t s [ i ]   =   S t r i n g T r i m L e f t ( m a r k e t s [ i ] ) ; 
 
 	 	 	 	 	 	 i f   ( m a r k e t s [ i ]   = =   " " )   { m a r k e t s [ i ]   =   S y m b o l ( ) ; } 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 f o r ( i   =   0 ;   i   <   m a r k e t s _ s i z e ;   i + + ) 
 	 	 	 { 
 	 	 	 	 i f   ( s y m b o l   = =   m a r k e t s [ i ] ) 
 	 	 	 	 { 
 	 	 	 	 	 m a r k e t _ p a s s   =   t r u e ; 
 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 i f   ( m a r k e t _ p a s s   = =   f a l s e ) 
 	 { 
 	 	 r e t u r n   f a l s e ; 
 	 } 
 
 	 r e t u r n   t r u e ; 
 }  
  
 v o i d   G e t B e t T r a d e s I n f o ( 
 	 d o u b l e   & o u t p u t [ ] , 
 	 s t r i n g   g r o u p , 
 	 s t r i n g   s y m b o l , 
 	 i n t   p o o l ,   / /   0 :   t r y   r u n n i n g   t r a d e s   f i r s t   a n d   t h e n   h i s t o r y   t r a d e s ,   1 :   t r y   r u n n i n g   o n l y ,   2 :   t r y   h i s t o r y   o n l y 
 	 b o o l   f i n d C o n s e c u t i v e   =   f a l s e 
 )   { 
 	 i f   ( A r r a y S i z e ( o u t p u t )   <   4 ) 
 	 { 
 	 	 A r r a y R e s i z e ( o u t p u t ,   4 ) ; 
 	 	 A r r a y I n i t i a l i z e ( o u t p u t ,   0 . 0 ) ; 
 	 } 
 
 	 d o u b l e   l o t s                   =   o u t p u t [ 0 ] ;   / /   w i l l   b e   t h e   l o t   s i z e   o f   t h e   f i r s t   l o a d e d   t r a d e 
 	 d o u b l e   p r o f i t O r L o s s   =   o u t p u t [ 1 ] ;   / /   0   i s   i n i t i a l   v a l u e ,   1   i s   p r o f i t ,   - 1   i s   l o s s 
 	 d o u b l e   c o n s e c u t i v e     =   o u t p u t [ 2 ] ;   / /   t h e   n u m b e r   o f   c o n s e c u t i v e   p r o f i t a b l e   o r   l o s a b l e   t r a d e s 
 	 d o u b l e   p r o f i t               =   o u t p u t [ 3 ] ;   / /   w i l l   b e   t h e   p r o f i t   o f   t h e   f i r s t   l o a d e d   t r a d e 
 	 b o o l   h i s t o r y T r a d e s     =   ( p o o l   = =   2 )   ?   t r u e   :   f a l s e ; 
 	 
 	 i n t   t o t a l   =   ( h i s t o r y T r a d e s )   ?   H i s t o r y T r a d e s T o t a l ( )   :   T r a d e s T o t a l ( ) ; 
 
 	 f o r   ( i n t   p o s   =   t o t a l   -   1 ;   p o s   > =   0 ;   p o s - - ) 
 	 { 
 	 	 i f   ( 
 	 	 	       ( ! h i s t o r y T r a d e s   & &   T r a d e S e l e c t B y I n d e x ( p o s ,   " g r o u p " ,   g r o u p ,   " s y m b o l " ,   s y m b o l ) ) 
 	 	 	 | |   ( h i s t o r y T r a d e s   & &   H i s t o r y T r a d e S e l e c t B y I n d e x ( p o s ,   " g r o u p " ,   g r o u p ,   " s y m b o l " ,   s y m b o l ) ) 
 	 	 )   { 
 	 	 	 i f   ( 
 	 	 	 	 ( T i m e C u r r e n t ( )   -   O r d e r O p e n T i m e ( )   <   3 )   / /   s k i p   f o r   b r a n d   n e w   t r a d e s 
 	 	 	 	 | | 
 	 	 	 	 ( 
 	 	 	 	 	 / /   e x c l u d e   e x p i r e d   p e n d i n g   o r d e r s 
 	 	 	 	 	 ! h i s t o r y T r a d e s 
 	 	 	 	 	 & &   O r d e r E x p i r a t i o n ( )   >   0 
 	 	 	 	 	 & &   O r d e r E x p i r a t i o n ( )   < =   O r d e r C l o s e T i m e ( ) 
 	 	 	 	 ) 
 	 	 	 )   { 
 	 	 	 	 c o n t i n u e ; 
 	 	 	 } 
 
 	 	 	 i f   ( l o t s   = =   0 . 0 ) 
 	 	 	 { 
 	 	 	 	 l o t s   =   O r d e r L o t s ( ) ; 
 	 	 	 } 
 
 	 	 	 p r o f i t   =   O r d e r C l o s e P r i c e ( )   -   O r d e r O p e n P r i c e ( ) ; 
 	 	 	 p r o f i t   =   N o r m a l i z e D o u b l e ( p r o f i t ,   S y m b o l D i g i t s ( O r d e r S y m b o l ( ) ) ) ; 
 	 	 	 
 	 	 	 i f   ( p r o f i t   = =   0 . 0 ) 
 	 	 	 { 
 	 	 	 	 / /   C o n s i d e r   a   t r a d e   w i t h   z e r o   p r o f i t   a s   n o n   e x i s t e n t 
 	 	 	 	 c o n t i n u e ; 
 	 	 	 } 
 
 	 	 	 i f   ( I s O r d e r T y p e S e l l ( ) ) 
 	 	 	 { 
 	 	 	 	 p r o f i t   =   - 1   *   p r o f i t ; 
 	 	 	 } 
 
 	 	 	 i f   ( p r o f i t O r L o s s   = =   0 ) 
 	 	 	 { 
 	 	 	 	 / /   W e   e n t e r   h e r e   o n l y   f o r   t h e   f i r s t   t r a d e 
 	 	 	 	 p r o f i t O r L o s s   =   ( p r o f i t   <   0 . 0 )   ?   - 1   :   1 ; 
 
 	 	 	 	 c o n s e c u t i v e + + ; 
 
 	 	 	 	 i f   ( f i n d C o n s e c u t i v e   = =   f a l s e )   b r e a k ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 / /   F o r   t h e   t r a d e s   a f t e r   t h e   f i r s t   o n e ,   i f   i t s   p r o f i t   i s   t h e   o p p o s i t e   o f   p r o f i t O r L o s s ,   w e   n e e d   t o   b r e a k 
 	 	 	 	 i f   ( 
 	 	 	 	 	       ( p r o f i t O r L o s s   >   0 . 0   & &   p r o f i t   <   0 . 0 ) 
 	 	 	 	 	 | |   ( p r o f i t O r L o s s   <   0 . 0   & &   p r o f i t   >   0 . 0 ) 
 	 	 	 	 )   { 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 
 	 	 	 	 c o n s e c u t i v e + + ; 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 o u t p u t [ 0 ]   =   l o t s ; 
 	 o u t p u t [ 1 ]   =   p r o f i t O r L o s s ; 
 	 o u t p u t [ 2 ]   =   c o n s e c u t i v e ; 
 	 o u t p u t [ 3 ]   =   p r o f i t ; 
 	 
 	 i f   ( p o o l   = =   0   & &   ( f i n d C o n s e c u t i v e   | |   p r o f i t O r L o s s   = =   0 ) ) 
 	 { 
 	 	 / /   r u n n i n g   t r a d e s   t r i e d ,   c o n t i n u e   w i t h   t h e   h i s t o r y   t r a d e s 
 	 	 p o o l   =   2 ; 
 	 	 G e t B e t T r a d e s I n f o ( o u t p u t ,   g r o u p ,   s y m b o l ,   p o o l ,   f i n d C o n s e c u t i v e ) ; 
 	 } 
 }  
  
 b o o l   H i s t o r y T r a d e S e l e c t B y I n d e x ( 
 	 i n t   i n d e x , 
 	 s t r i n g   g r o u p _ m o d e         =   " a l l " , 
 	 s t r i n g   g r o u p                   =   " 0 " , 
 	 s t r i n g   m a r k e t _ m o d e       =   " a l l " , 
 	 s t r i n g   m a r k e t                 =   " " , 
 	 s t r i n g   B u y s O r S e l l s       =   " b o t h " 
 )   { 
 	 i f   ( O r d e r S e l e c t ( ( i n t ) i n d e x ,   S E L E C T _ B Y _ P O S ,   M O D E _ H I S T O R Y )   & &   O r d e r T y p e ( )   <   2 ) 
 	 { 
 	 	 i f   ( F i l t e r O r d e r B y ( 
 	 	 	 g r o u p _ m o d e , 
 	 	 	 g r o u p , 
 	 	 	 m a r k e t _ m o d e , 
 	 	 	 m a r k e t , 
 	 	 	 B u y s O r S e l l s ) 
 	 	 )   { 
 	 	 	 r e t u r n   t r u e ; 
 	 	 } 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 i n t   H i s t o r y T r a d e s T o t a l ( d a t e t i m e   f r o m _ d a t e = 0 ,   d a t e t i m e   t o _ d a t e = 0 ) 
 { 
 	 / /   b o t h   i n p u t   p a r a m e t e r s   a r e   d u m m y 
 	 / /   t h e y   e x i s t   o n l y   t o   m a k e   t h e   f u n c t i o n   c o m p a t i b l e   w i t h   M Q L 5 - l i k e   c o d e 
 
 	 r e t u r n   O r d e r s H i s t o r y T o t a l ( ) ; 
 }  
  
 t e m p l a t e < t y p e n a m e   T > 
 b o o l   I n A r r a y ( T   & a r r a y [ ] ,   T   v a l u e ) 
 { 
 	 i n t   s i z e   =   A r r a y S i z e ( a r r a y ) ; 
 
 	 i f   ( s i z e   >   0 ) 
 	 { 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 	 { 
 	 	 	 i f   ( a r r a y [ i ]   = =   v a l u e ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   t r u e ; 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 b o o l   I s O r d e r T y p e S e l l ( ) 
 { 
 	 i n t   t y p e   =   O r d e r T y p e ( ) ; 
 
 	 r e t u r n   ( t y p e   = =   O P _ S E L L   | |   t y p e   = =   O P _ S E L L S T O P   | |   t y p e   = =   O P _ S E L L L I M I T ) ; 
 }  
  
 s t r i n g   L o a d e d O b j e c t N a m e ( s t r i n g   n a m e = " " )   { s t a t i c   s t r i n g   m e m o r y = " " ;   i f   ( n a m e ! = " " )   { m e m o r y = n a m e ; }   r e t u r n ( m e m o r y ) ; }  
  
 b o o l   M o d i f y O r d e r ( 
 	 l o n g   t i c k e t , 
 	 d o u b l e   o p , 
 	 d o u b l e   s l l   =   0 , 
 	 d o u b l e   t p l   =   0 , 
 	 d o u b l e   s l p   =   0 , 
 	 d o u b l e   t p p   =   0 , 
 	 d a t e t i m e   e x p   =   0 , 
 	 c o l o r   c l r   =   c l r N O N E , 
 	 b o o l   o n t r a d e _ e v e n t   =   t r u e 
 )   { 
 	 i n t   b s   =   1 ; 
 
 	 i f   ( 
 	 	       O r d e r T y p e ( )   = =   O P _ S E L L 
 	 	 | |   O r d e r T y p e ( )   = =   O P _ S E L L S T O P 
 	 	 | |   O r d e r T y p e ( )   = =   O P _ S E L L L I M I T 
 	 ) 
 	 { b s   =   - 1 ; }   / /   P o s i t i v e   w h e n   B u y ,   n e g a t i v e   w h e n   S e l l 
 
 	 w h i l e   ( t r u e ) 
 	 { 
 	 	 u i n t   t i m e 0   =   G e t T i c k C o u n t ( ) ; 
 
 	 	 W a i t T r a d e C o n t e x t I f B u s y ( ) ; 
 
 	 	 i f   ( ! O r d e r S e l e c t ( ( i n t ) t i c k e t ,   S E L E C T _ B Y _ T I C K E T ) ) 
 	 	 { 
 	 	 	 r e t u r n   f a l s e ; 
 	 	 } 
 
 	 	 s t r i n g   s y m b o l             =   O r d e r S y m b o l ( ) ; 
 	 	 i n t   t y p e                       =   O r d e r T y p e ( ) ; 
 	 	 d o u b l e   a s k                   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 	 	 d o u b l e   b i d                   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ; 
 	 	 i n t   d i g i t s                   =   ( i n t ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ D I G I T S ) ; 
 	 	 d o u b l e   p o i n t               =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ; 
 	 	 d o u b l e   s t o p l e v e l       =   p o i n t   *   S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ T R A D E _ S T O P S _ L E V E L ) ; 
 	 	 d o u b l e   f r e e z e l e v e l   =   p o i n t   *   S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ T R A D E _ F R E E Z E _ L E V E L ) ; 
 
 	 	 i f   ( O r d e r T y p e ( )   <   2 )   { o p   =   O r d e r O p e n P r i c e ( ) ; }   e l s e   { o p   =   N o r m a l i z e D o u b l e ( o p , d i g i t s ) ; } 
 
 	 	 s l l   =   N o r m a l i z e D o u b l e ( s l l ,   d i g i t s ) ; 
 	 	 t p l   =   N o r m a l i z e D o u b l e ( t p l ,   d i g i t s ) ; 
 
 	 	 i f   ( o p   <   0   | |   o p   > =   E M P T Y _ V A L U E   | |   s l l   <   0   | |   s l p   <   0   | |   t p l   <   0   | |   t p p   <   0 ) 
 	 	 { 
 	 	 	 b r e a k ; 
 	 	 } 
 	 	 
 	 	 / / - -   O P   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 / /   h t t p s : / / b o o k . m q l 4 . c o m / a p p e n d i x / l i m i t s 
 	 	 i f   ( t y p e   = =   O P _ B U Y L I M I T ) 
 	 	 { 
 	 	 	 i f   ( a s k   -   o p   <   s t o p l e v e l )   { o p   =   a s k   -   s t o p l e v e l ; } 
 	 	 	 i f   ( a s k   -   o p   < =   f r e e z e l e v e l )   { o p   =   a s k   -   f r e e z e l e v e l   -   p o i n t ; } 
 	 	 } 
 	 	 e l s e   i f   ( t y p e   = =   O P _ B U Y S T O P ) 
 	 	 { 
 	 	 	 i f   ( o p   -   a s k   <   s t o p l e v e l )   { o p   =   a s k   +   s t o p l e v e l ; } 
 	 	 	 i f   ( o p   -   a s k   < =   f r e e z e l e v e l )   { o p   =   a s k   +   f r e e z e l e v e l   +   p o i n t ; } 
 	 	 } 
 	 	 e l s e   i f   ( t y p e   = =   O P _ S E L L L I M I T ) 
 	 	 { 
 	 	 	 i f   ( o p   -   b i d   <   s t o p l e v e l )   { o p   =   b i d   +   s t o p l e v e l ; } 
 	 	 	 i f   ( o p   -   b i d   < =   f r e e z e l e v e l )   { o p   =   b i d   +   f r e e z e l e v e l   +   p o i n t ; } 
 	 	 } 
 	 	 e l s e   i f   ( t y p e   = =   O P _ S E L L S T O P ) 
 	 	 { 
 	 	 	 i f   ( b i d   -   o p   <   s t o p l e v e l )   { o p   =   b i d   -   s t o p l e v e l ; } 
 	 	 	 i f   ( b i d   -   o p   <   f r e e z e l e v e l )   { o p   =   b i d   -   f r e e z e l e v e l   -   p o i n t ; } 
 	 	 } 
 
 	 	 o p   =   N o r m a l i z e D o u b l e ( o p ,   d i g i t s ) ; 
 
 	 	 / / - -   S L   a n d   T P   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 d o u b l e   s l   =   0 ,   t p   =   0 ,   v s l   =   0 ,   v t p   =   0 ; 
 
 	 	 s l   =   A l i g n S t o p L o s s ( s y m b o l ,   t y p e ,   o p ,   a t t r S t o p L o s s ( ) ,   s l l ,   s l p ) ; 
 
 	 	 i f   ( s l   <   0 )   { b r e a k ; } 
 
 	 	 t p   =   A l i g n T a k e P r o f i t ( s y m b o l ,   t y p e ,   o p ,   a t t r T a k e P r o f i t ( ) ,   t p l ,   t p p ) ; 
 
 	 	 i f   ( t p   <   0 )   { b r e a k ; } 
 
 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 { 
 	 	 	 / / - -   v i r t u a l   S L   a n d   T P   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 	 v s l   =   s l ; 
 	 	 	 v t p   =   t p ; 
 	 	 	 s l   =   0 ; 
 	 	 	 t p   =   0 ; 
 
 	 	 	 d o u b l e   a s k b i d   =   a s k ; 
 	 	 	 i f   ( b s   <   0 )   { a s k b i d   =   b i d ; } 
 
 	 	 	 i f   ( v s l   >   0   | |   U S E _ E M E R G E N C Y _ S T O P S   = =   " a l w a y s " ) 
 	 	 	 { 
 	 	 	 	 i f   ( E M E R G E N C Y _ S T O P S _ R E L   >   0   | |   E M E R G E N C Y _ S T O P S _ A D D   >   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 s l   =   v s l   -   E M E R G E N C Y _ S T O P S _ R E L * M a t h A b s ( a s k b i d - v s l ) * b s ; 
 
 	 	 	 	 	 i f   ( s l   < =   0 )   { s l   =   a s k b i d ; } 
 
 	 	 	 	 	 s l   =   s l   -   t o D i g i t s ( E M E R G E N C Y _ S T O P S _ A D D , s y m b o l ) * b s ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 i f   ( v t p   >   0   | |   U S E _ E M E R G E N C Y _ S T O P S   = =   " a l w a y s " ) 
 	 	 	 { 
 	 	 	 	 i f   ( E M E R G E N C Y _ S T O P S _ R E L   >   0   | |   E M E R G E N C Y _ S T O P S _ A D D   >   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 t p   =   v t p   +   E M E R G E N C Y _ S T O P S _ R E L * M a t h A b s ( v t p - a s k b i d ) * b s ; 
 
 	 	 	 	 	 i f   ( t p   < =   0 )   { t p   =   a s k b i d ; } 
 
 	 	 	 	 	 t p   =   t p   +   t o D i g i t s ( E M E R G E N C Y _ S T O P S _ A D D , s y m b o l ) * b s ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 v s l   =   N o r m a l i z e D o u b l e ( v s l , d i g i t s ) ; 
 	 	 	 v t p   =   N o r m a l i z e D o u b l e ( v t p , d i g i t s ) ; 
 	 	 } 
 
 	 	 s l   =   N o r m a l i z e D o u b l e ( s l , d i g i t s ) ; 
 	 	 t p   =   N o r m a l i z e D o u b l e ( t p , d i g i t s ) ; 
 
 	 	 / / - -   m o d i f y   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 R e s e t L a s t E r r o r ( ) ; 
 	 	 
 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 { 
 	 	 	 i f   ( v s l   ! =   a t t r S t o p L o s s ( )   | |   v t p   ! =   a t t r T a k e P r o f i t ( ) ) 
 	 	 	 { 
 	 	 	 	 V i r t u a l S t o p s D r i v e r ( " s e t " ,   t i c k e t ,   v s l ,   v t p ,   t o P i p s ( M a t h A b s ( o p - v s l ) ,   s y m b o l ) ,   t o P i p s ( M a t h A b s ( v t p - o p ) ,   s y m b o l ) ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 b o o l   s u c c e s s   =   f a l s e ; 
 
 	 	 i f   ( 
 	 	 	       ( O r d e r T y p e ( )   >   1   & &   o p   ! =   N o r m a l i z e D o u b l e ( O r d e r O p e n P r i c e ( ) , d i g i t s ) ) 
 	 	 	 | |   s l   ! =   N o r m a l i z e D o u b l e ( O r d e r S t o p L o s s ( ) , d i g i t s ) 
 	 	 	 | |   t p   ! =   N o r m a l i z e D o u b l e ( O r d e r T a k e P r o f i t ( ) , d i g i t s ) 
 	 	 	 | |   e x p   ! =   O r d e r E x p i r a t i o n T i m e ( ) 
 	 	 )   { 
 	 	 	 s u c c e s s   =   O r d e r M o d i f y ( ( i n t ) t i c k e t ,   o p ,   s l ,   t p ,   e x p ,   c l r ) ; 
 	 	 } 
 
 	 	 / / - -   e r r o r   c h e c k   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 i n t   e r r a c t i o n   =   C h e c k F o r T r a d i n g E r r o r ( G e t L a s t E r r o r ( ) ,   " M o d i f y   e r r o r " ) ; 
 
 	 	 s w i t c h ( e r r a c t i o n ) 
 	 	 { 
 	 	 	 c a s e   0 :   b r e a k ;         / /   n o   e r r o r 
 	 	 	 c a s e   1 :   c o n t i n u e ;   / /   o v e r c o m a b l e   e r r o r 
 	 	 	 c a s e   2 :   b r e a k ;         / /   f a t a l   e r r o r 
 	 	 } 
 
 	 	 / / - -   f i n i s h   w o r k   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 i f   ( s u c c e s s   = =   t r u e ) 
 	 	 { 
 	 	 	 i f   ( ! I s T e s t i n g ( )   & &   ! I s V i s u a l M o d e ( ) ) 
 	 	 	 { 
 	 	 	 	 P r i n t ( " O p e r a t i o n   d e t a i l s :   S p e e d   "   +   ( s t r i n g ) ( G e t T i c k C o u n t ( ) - t i m e 0 )   +   "   m s " ) ; 
 	 	 	 } 
 
 	 	 	 i f   ( o n t r a d e _ e v e n t   = =   t r u e ) 
 	 	 	 { 
 	 	 	 	 O r d e r M o d i f i e d ( t i c k e t ) ; 
 	 	 	 	 O n T r a d e ( ) ; 
 	 	 	 } 
 
 	 	 	 i f   ( O r d e r S e l e c t ( ( i n t ) t i c k e t , S E L E C T _ B Y _ T I C K E T ) )   { } 
 
 	 	 	 r e t u r n   t r u e ; 
 	 	 } 
 
 	 	 b r e a k ; 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 b o o l   M o d i f y S t o p s ( i n t   t i c k e t ,   d o u b l e   s l = - 1 ,   d o u b l e   t p = - 1 ,   c o l o r   c l r = c l r N O N E ) 
 { 
       r e t u r n   M o d i f y O r d e r ( 
 	 	 t i c k e t , 
 	 	 O r d e r O p e n P r i c e ( ) , 
 	 	 s l , 
 	 	 t p , 
 	 	 0 , 
 	 	 0 , 
 	 	 O r d e r E x p i r a t i o n T i m e ( ) , 
 	 	 c l r 
 	 ) ; 
 }  
  
 i n t   O C O D r i v e r ( ) 
 { 
 	 s t a t i c   i n t   l a s t _ k n o w n _ t i c k e t   =   0 ; 
       s t a t i c   i n t   o r d e r s 1 [ ] ; 
       s t a t i c   i n t   o r d e r s 2 [ ] ; 
       i n t   i ,   s i z e ; 
       
       i n t   t o t a l   =   O r d e r s T o t a l ( ) ; 
       
       f o r   ( i n t   p o s = t o t a l - 1 ;   p o s > = 0 ;   p o s - - ) 
       { 
             i f   ( O r d e r S e l e c t ( p o s , S E L E C T _ B Y _ P O S , M O D E _ T R A D E S ) ) 
             { 
                   i n t   t i c k e t   =   O r d e r T i c k e t ( ) ; 
                   
                   / / - -   e n d   h e r e   i f   w e   r e a c h   t h e   l a s t   k n o w n   t i c k e t 
                   i f   ( t i c k e t   = =   l a s t _ k n o w n _ t i c k e t )   { b r e a k ; } 
                   
                   / / - -   s e t   t h e   l a s t   k n o w n   t i c k e t ,   o n l y   i f   t h i s   i s   t h e   f i r s t   i t e r a t i o n 
                   i f   ( p o s   = =   t o t a l - 1 )   { 
                         l a s t _ k n o w n _ t i c k e t   =   t i c k e t ; 
                   } 
                   
                   / / - -   w e   a r e   s e a r c h i n g   f o r   p e n d i n g   o r d e r s ,   s k i p   t r a d e s 
                   i f   ( O r d e r T y p e ( )   < =   O P _ S E L L )   { c o n t i n u e ; } 
                   
                   / / - - 
                   i f   ( S t r i n g S u b s t r ( O r d e r C o m m e n t ( ) ,   0 ,   5 )   = =   " [ o c o : " ) 
                   { 
                         i n t   t i c k e t _ o c o   =   S t r T o I n t e g e r ( S t r i n g S u b s t r ( O r d e r C o m m e n t ( ) ,   5 ,   S t r i n g L e n ( O r d e r C o m m e n t ( ) ) - 1 ) ) ;   
                         
                         b o o l   f o u n d   =   f a l s e ; 
                         s i z e   =   A r r a y S i z e ( o r d e r s 2 ) ; 
                         f o r   ( i = 0 ;   i < s i z e ;   i + + ) 
                         { 
                               i f   ( o r d e r s 2 [ i ]   = =   t i c k e t _ o c o )   { 
                                     f o u n d   =   t r u e ; 
                                     b r e a k ; 
                               } 
                         } 
                         
                         i f   ( f o u n d   = =   f a l s e )   { 
                               A r r a y R e s i z e ( o r d e r s 1 ,   s i z e + 1 ) ; 
                               A r r a y R e s i z e ( o r d e r s 2 ,   s i z e + 1 ) ; 
                               o r d e r s 1 [ s i z e ]   =   t i c k e t _ o c o ; 
                               o r d e r s 2 [ s i z e ]   =   t i c k e t ; 
                         } 
                   } 
             } 
       } 
       
       s i z e   =   A r r a y S i z e ( o r d e r s 1 ) ; 
       i n t   d b r e m o v e   =   f a l s e ; 
       f o r   ( i = s i z e - 1 ;   i > = 0 ;   i - - ) 
       { 
             i f   ( O r d e r S e l e c t ( o r d e r s 1 [ i ] ,   S E L E C T _ B Y _ T I C K E T ,   M O D E _ T R A D E S )   = =   f a l s e   | |   O r d e r T y p e ( )   < =   O P _ S E L L ) 
             { 
                   i f   ( O r d e r S e l e c t ( o r d e r s 2 [ i ] ,   S E L E C T _ B Y _ T I C K E T ,   M O D E _ T R A D E S ) )   { 
                         i f   ( D e l e t e O r d e r ( o r d e r s 2 [ i ] , c l r W h i t e ) ) 
                         { 
                               d b r e m o v e   =   t r u e ; 
                         } 
                   } 
                   e l s e   { 
                         d b r e m o v e   =   t r u e ; 
                   } 
                   
                   i f   ( d b r e m o v e   = =   t r u e ) 
                   { 
                         A r r a y S t r i p K e y ( o r d e r s 1 ,   i ) ; 
                         A r r a y S t r i p K e y ( o r d e r s 2 ,   i ) ; 
                   } 
             } 
       } 
       
       s i z e   =   A r r a y S i z e ( o r d e r s 2 ) ; 
       d b r e m o v e   =   f a l s e ; 
       f o r   ( i = s i z e - 1 ;   i > = 0 ;   i - - ) 
       { 
             i f   ( O r d e r S e l e c t ( o r d e r s 2 [ i ] ,   S E L E C T _ B Y _ T I C K E T ,   M O D E _ T R A D E S )   = =   f a l s e   | |   O r d e r T y p e ( )   < =   O P _ S E L L ) 
             { 
                   i f   ( O r d e r S e l e c t ( o r d e r s 1 [ i ] ,   S E L E C T _ B Y _ T I C K E T ,   M O D E _ T R A D E S ) )   { 
                         i f   ( D e l e t e O r d e r ( o r d e r s 1 [ i ] , c l r W h i t e ) ) 
                         { 
                               d b r e m o v e   =   t r u e ; 
                         } 
                   } 
                   e l s e   { 
                         d b r e m o v e   =   t r u e ; 
                   } 
                   
                   i f   ( d b r e m o v e   = =   t r u e ) 
                   { 
                         A r r a y S t r i p K e y ( o r d e r s 1 ,   i ) ; 
                         A r r a y S t r i p K e y ( o r d e r s 2 ,   i ) ; 
                   } 
             } 
       } 
       
       r e t u r n   t r u e ; 
 }  
  
 d o u b l e   O b j e c t G e t V a l u e B y S h i f t ( l o n g   c t a r t _ i d ,   s t r i n g   n a m e ,   i n t   s h i f t ) 
 { 
 	 M q l R a t e s   r a t e s [ ] ; 
 	 C o p y R a t e s ( N U L L ,   P E R I O D _ C U R R E N T ,   s h i f t ,   1 ,   r a t e s ) ; 
 
 	 r e t u r n   O b j e c t G e t V a l u e B y T i m e ( c t a r t _ i d ,   n a m e ,   r a t e s [ 0 ] . t i m e ,   0 ) ; 
 }  
  
 b o o l   O n T i m e r S e t ( d o u b l e   s e c o n d s )  
 {  
       i f   ( F X D _ O N T I M E R _ T A K E N )  
       {  
             i f   ( s e c o n d s < = 0 )   {  
                   F X D _ O N T I M E R _ T A K E N _ I N _ M I L L I S E C O N D S   =   f a l s e ;  
                   F X D _ O N T I M E R _ T A K E N _ T I M E   =   0 ;  
             }  
             e l s e   i f   ( s e c o n d s   <   1 )   {  
                   F X D _ O N T I M E R _ T A K E N _ I N _ M I L L I S E C O N D S   =   t r u e ;  
                   F X D _ O N T I M E R _ T A K E N _ T I M E   =   s e c o n d s * 1 0 0 0 ;    
             }  
             e l s e   {  
                   F X D _ O N T I M E R _ T A K E N _ I N _ M I L L I S E C O N D S   =   f a l s e ;  
                   F X D _ O N T I M E R _ T A K E N _ T I M E   =   s e c o n d s ;  
             }  
              
             r e t u r n   t r u e ;  
       }  
  
       i f   ( s e c o n d s < = 0 )   {  
             E v e n t K i l l T i m e r ( ) ;  
       }  
       e l s e   i f   ( s e c o n d s   <   1 )   {  
             r e t u r n   ( E v e n t S e t M i l l i s e c o n d T i m e r ( ( i n t ) ( s e c o n d s * 1 0 0 0 ) ) ) ;      
       }  
       e l s e   {  
             r e t u r n   ( E v e n t S e t T i m e r ( ( i n t ) s e c o n d s ) ) ;  
       }  
        
       r e t u r n   t r u e ;  
 }  
  
 c l a s s   O n T r a d e E v e n t D e t e c t o r 
 { 
 p r i v a t e : 
 	 / / - - -   s t r u c t u r e s 
 	 s t r u c t   E v e n t V a l u e s 
 	 { 
 	 	 / /   s p e c i a l   f i e l d s 
 	 	 s t r i n g       r e a s o n , 
 	 	                   d e t a i l ; 
 
 	 	 / /   o r d e r   r e l a t e d   f i e l d s 
 	 	 l o n g           m a g i c , 
 	 	                   t i c k e t ; 
 	 	 i n t             t y p e ; 
 	 	 d a t e t i m e   t i m e C l o s e , 
 	 	                   t i m e O p e n , 
 	 	                   t i m e E x p i r a t i o n ; 
 	 	 d o u b l e       c o m m i s s i o n , 
 	 	                   p r i c e O p e n , 
 	 	                   p r i c e C l o s e , 
 	 	                   p r o f i t , 
 	 	                   s t o p L o s s , 
 	 	                   s w a p , 
 	 	                   t a k e P r o f i t , 
 	 	                   v o l u m e ; 
 	 	 s t r i n g       c o m m e n t , 
 	 	                   s y m b o l ; 
 	 } ; 
 	 
 	 s t r u c t   P o s i t i o n 
 	 { 
 	 	 i n t   t y p e ; 
 	 	 l o n g           m a g i c , 
 	 	                   t i c k e t ; 
 	 	 d a t e t i m e   t i m e C l o s e , 
 	 	                   t i m e E x p i r a t i o n , 
 	 	                   t i m e O p e n ; 
 	 	 d o u b l e       c o m m i s s i o n , 
 	 	                   p r i c e C u r r e n t , 
 	 	                   p r i c e O p e n , 
 	 	                   p r o f i t , 
 	 	                   s t o p L o s s , 
 	 	                   s w a p , 
 	 	                   t a k e P r o f i t , 
 	 	                   v o l u m e ; 
 	 	 s t r i n g       c o m m e n t , 
 	 	                   s y m b o l ; 
 	 } ; 
 
 	 s t r u c t   P e n d i n g O r d e r 
 	 { 
 	 	 i n t   t y p e ; 
 	 	 l o n g           m a g i c , 
 	 	                   t i c k e t ; 
 	 	 d a t e t i m e   t i m e C l o s e , 
 	 	                   t i m e E x p i r a t i o n , 
 	 	                   t i m e O p e n ; 
 	 	 d o u b l e       p r i c e C u r r e n t , 
 	 	                   p r i c e O p e n , 
 	 	                   s t o p L o s s , 
 	 	                   t a k e P r o f i t , 
 	 	                   v o l u m e ; 
 	 	 s t r i n g       c o m m e n t , 
 	 	                   s y m b o l ; 
 	 } ; 
 	 
 	 s t r u c t   P o s i t i o n E x p i r a t i o n T i m e s 
 	 { 
 	 	 l o n g   t i c k e t ; 
 	 	 d a t e t i m e   t i m e E x p i r a t i o n ; 
 	 } ; 
 	 
 	 / / - - -   v a r i a b l e s   a n d   a r r a y s 
 	 b o o l   d e b u g ; 
 
 	 i n t   e v e n t V a l u e s Q u e u e I n d e x ; 
 	 E v e n t V a l u e s   e v e n t V a l u e s [ ] ; 
 
 	 P e n d i n g O r d e r   p r e v i o u s P e n d i n g O r d e r s [ ] ; 
 	 P e n d i n g O r d e r   p e n d i n g O r d e r s [ ] ; 
 
 	 P o s i t i o n   p r e v i o u s P o s i t i o n s [ ] ; 
 	 P o s i t i o n   p o s i t i o n s [ ] ; 
 
 	 P o s i t i o n E x p i r a t i o n T i m e s   p o s i t i o n E x p i r a t i o n T i m e s [ ] ; 
 
 	 / / - - -   m e t h o d s 
 	 
 	 / * * 
 	 *   L i k e   A r r a y C o p y ( ) ,   b u t   f o r   a n y   t y p e . 
 	 * / 
 	 t e m p l a t e < t y p e n a m e   T > 
 	 v o i d   C o p y L i s t ( T   & d e s t [ ] ,   T   & s r c [ ] ) 
 	 { 
 	 	 i n t   s i z e   =   A r r a y S i z e ( s r c ) ; 
 	 	 A r r a y R e s i z e ( d e s t ,   s i z e ) ; 
 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 	 { 
 	 	 	 d e s t [ i ]   =   s r c [ i ] ; 
 	 	 } 
 	 } 
 
 	 / * * 
 	 *   O v e r l o a d e d   m e t h o d   1   o f   2 
 	 * / 
 	 i n t   M a k e L i s t O f ( P e n d i n g O r d e r   & l i s t [ ] ) 
 	 { 
 	 	 A r r a y R e s i z e ( l i s t ,   0 ) ; 
 
 	 	 i n t   c o u n t                 =   O r d e r s T o t a l ( ) ; 
 	 	 i n t   h o w M a n y A d d e d   =   0 ; 
 
 	 	 f o r   ( i n t   i n d e x   =   0 ;   i n d e x   <   c o u n t ;   i n d e x + + ) 
 	 	 { 
 	 	 	 i f   ( O r d e r S e l e c t ( i n d e x ,   S E L E C T _ B Y _ P O S )   = =   f a l s e )   c o n t i n u e ; 
 	 	 	 i f   ( O r d e r T y p e ( )   <   O P _ B U Y L I M I T )   c o n t i n u e ; 
 
 	 	 	 h o w M a n y A d d e d + + ; 
 	 	 	 A r r a y R e s i z e ( l i s t ,   h o w M a n y A d d e d ) ; 
 	 	 	 i n t   i   =   h o w M a n y A d d e d   -   1 ; 
 
 	 	 	 / /   i n t 
 	 	 	 l i s t [ i ] . t y p e       =   O r d e r T y p e ( ) ; 
 	 	 	 l i s t [ i ] . m a g i c     =   O r d e r M a g i c N u m b e r ( ) ; 
 	 	 	 l i s t [ i ] . t i c k e t   =   O r d e r T i c k e t ( ) ; 
 
 	 	 	 / /   d a t e t i m e 
 	 	 	 l i s t [ i ] . t i m e C l o s e             =   O r d e r C l o s e T i m e ( ) ; 
 	 	 	 l i s t [ i ] . t i m e E x p i r a t i o n   =   O r d e r E x p i r a t i o n ( ) ; 
 	 	 	 l i s t [ i ] . t i m e O p e n               =   O r d e r O p e n T i m e ( ) ; 
 
 	 	 	 / /   d o u b l e 
 	 	 	 l i s t [ i ] . p r i c e C u r r e n t   =   O r d e r C l o s e P r i c e ( ) ; 
 	 	 	 l i s t [ i ] . p r i c e O p e n         =   O r d e r O p e n P r i c e ( ) ; 
 	 	 	 l i s t [ i ] . s t o p L o s s           =   O r d e r S t o p L o s s ( ) ; 
 	 	 	 l i s t [ i ] . t a k e P r o f i t       =   O r d e r T a k e P r o f i t ( ) ; 
 	 	 	 l i s t [ i ] . v o l u m e               =   O r d e r L o t s ( ) ; 
 
 	 	 	 / /   s t r i n g 
 	 	 	 l i s t [ i ] . c o m m e n t   =   O r d e r C o m m e n t ( ) ; 
 	 	 	 l i s t [ i ] . s y m b o l     =   O r d e r S y m b o l ( ) ; 
 	 	 } 
 
 	 	 r e t u r n   h o w M a n y A d d e d ; 
 	 } 
 
 	 / * * 
 	 *   O v e r l o a d e d   m e t h o d   2   o f   2 
 	 * / 
 	 i n t   M a k e L i s t O f ( P o s i t i o n   & l i s t [ ] ) 
 	 { 
 	 	 A r r a y R e s i z e ( l i s t ,   0 ) ; 
 
 	 	 i n t   c o u n t                 =   O r d e r s T o t a l ( ) ; 
 	 	 i n t   h o w M a n y A d d e d   =   0 ; 
 
 	 	 f o r   ( i n t   i n d e x   =   0 ;   i n d e x   <   c o u n t ;   i n d e x + + ) 
 	 	 { 
 	 	 	 i f   ( O r d e r S e l e c t ( i n d e x ,   S E L E C T _ B Y _ P O S )   = =   f a l s e )   c o n t i n u e ; 
 	 	 	 i f   ( O r d e r T y p e ( )   >   O P _ S E L L )   c o n t i n u e ; 
 
 	 	 	 h o w M a n y A d d e d + + ; 
 	 	 	 A r r a y R e s i z e ( l i s t ,   h o w M a n y A d d e d ) ; 
 	 	 	 i n t   i   =   h o w M a n y A d d e d   -   1 ; 
 
 	 	 	 / /   i n t 
 	 	 	 l i s t [ i ] . t y p e       =   O r d e r T y p e ( ) ; 
 	 	 	 l i s t [ i ] . m a g i c     =   O r d e r M a g i c N u m b e r ( ) ; 
 	 	 	 l i s t [ i ] . t i c k e t   =   O r d e r T i c k e t ( ) ; 
 
 	 	 	 / /   d a t e t i m e 
 	 	 	 l i s t [ i ] . t i m e C l o s e             =   O r d e r C l o s e T i m e ( ) ; 
 	 	 	 l i s t [ i ] . t i m e E x p i r a t i o n   =   ( d a t e t i m e ) 0 ; 
 	 	 	 l i s t [ i ] . t i m e O p e n               =   O r d e r O p e n T i m e ( ) ; 
 
 	 	 	 / /   d o u b l e 
 	 	 	 l i s t [ i ] . c o m m i s s i o n       =   O r d e r C o m m i s s i o n ( ) ; 
 	 	 	 l i s t [ i ] . p r i c e C u r r e n t   =   O r d e r C l o s e P r i c e ( ) ; 
 	 	 	 l i s t [ i ] . p r i c e O p e n         =   O r d e r O p e n P r i c e ( ) ; 
 	 	 	 l i s t [ i ] . p r o f i t               =   O r d e r P r o f i t ( ) ; 
 	 	 	 l i s t [ i ] . s t o p L o s s           =   O r d e r S t o p L o s s ( ) ; 
 	 	 	 l i s t [ i ] . s w a p                   =   O r d e r S w a p ( ) ; 
 	 	 	 l i s t [ i ] . t a k e P r o f i t       =   O r d e r T a k e P r o f i t ( ) ; 
 	 	 	 l i s t [ i ] . v o l u m e               =   O r d e r L o t s ( ) ; 
 
 	 	 	 / /   s t r i n g 
 	 	 	 l i s t [ i ] . c o m m e n t   =   O r d e r C o m m e n t ( ) ; 
 	 	 	 l i s t [ i ] . s y m b o l     =   O r d e r S y m b o l ( ) ; 
 	 	 	 
 	 	 	 / /   e x t r a c t   e x p i r a t i o n 
 	 	 	 l i s t [ i ] . t i m e E x p i r a t i o n   =   e x p i r a t i o n W o r k e r . G e t E x p i r a t i o n ( l i s t [ i ] . t i c k e t ) ; 
 
 	 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 	 { 
 	 	 	 	 l i s t [ i ] . s t o p L o s s       =   V i r t u a l S t o p s D r i v e r ( " g e t   s l " ,   l i s t [ i ] . t i c k e t ) ; 
 	 	 	 	 l i s t [ i ] . t a k e P r o f i t   =   V i r t u a l S t o p s D r i v e r ( " g e t   t p " ,   l i s t [ i ] . t i c k e t ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 r e t u r n   h o w M a n y A d d e d ; 
 	 } 
 
 	 / * * 
 	 *   T h i s   m e t h o d   l o o p s   t h r o u g h   2   l i s t s   o f   i t e m s   a n d   f i n d s   a   d i f f e r e n c e .   T h i s   d i f f e r e n c e   i s   t h e   e v e n t . 
 	 *   " I t e m s "   a r e   e i t h e r   p e n d i n g   o r d e r s   o r   p o s i t i o n s . 
 	 * 
 	 *   R e t u r n s   t r u e   i f   a n   e v e n t   i s   d e t e c t e d   o r   f a l s e   i f   n o t . 
 	 * / 
 	 t e m p l a t e < t y p e n a m e   I T E M S _ T Y P E >   
 	 b o o l   D e t e c t E v e n t ( I T E M S _ T Y P E   & p r e v i o u s I t e m s [ ] ,   I T E M S _ T Y P E   & c u r r e n t I t e m s [ ] ) 
 	 { 
 	 	 I T E M S _ T Y P E   i t e m ; 
 	 	 s t r i n g   r e a s o n       =   " " ; 
 	 	 s t r i n g   d e t a i l       =   " " ; 
 	 	 i n t   c o u n t B e f o r e   =   A r r a y S i z e ( p r e v i o u s I t e m s ) ; 
 	 	 i n t   c o u n t N o w         =   A r r a y S i z e ( c u r r e n t I t e m s ) ; 
 
 	 	 / /   N e w 
 	 	 i f   ( c o u n t B e f o r e   <   c o u n t N o w ) 
 	 	 { 
 	 	 	 i t e m       =   c u r r e n t I t e m s [ c o u n t N o w   -   1 ] ; 
 	 	 	 r e a s o n   =   " n e w " ; 
 	 	 } 
 	 	 / /   G o n e 
 	 	 e l s e   i f   ( c o u n t B e f o r e   >   c o u n t N o w ) 
 	 	 { 
 	 	 	 i t e m       =   F i n d M i s s i n g I t e m ( p r e v i o u s I t e m s ,   c u r r e n t I t e m s ) ; 
 	 	 	 r e a s o n   =   " c l o s e " ; 
 	 	 } 
 	 	 / /   S a m e   = >   c h e c k   f o r   m o d i f i c a t i o n s 
 	 	 e l s e   i f   ( c o u n t B e f o r e   = =   c o u n t N o w   & &   c o u n t N o w   >   0 ) 
 	 	 { 
 	 	 	 i n t   c o u n t   =   A r r a y S i z e ( c u r r e n t I t e m s ) ; 
 
 	 	 	 f o r   ( i n t   i n d e x   =   0 ;   i n d e x   <   c o u n t ;   i n d e x + + ) 
 	 	 	 { 
 	 	 	 	 i t e m   =   c u r r e n t I t e m s [ i n d e x ] ; 
 	 	 	 	 I T E M S _ T Y P E   p r e v i o u s   =   p r e v i o u s I t e m s [ i n d e x ] ; 
 	 	 	 	 I T E M S _ T Y P E   c u r r e n t     =   c u r r e n t I t e m s [ i n d e x ] ; 
 
 	 	 	 	 i f   ( p r e v i o u s . t i c k e t   ! =   c u r r e n t . t i c k e t ) 
 	 	 	 	 { 
 	 	 	 	 	 / /   T h e   o r d e r   c h a n g e s   w h e n   a   t r a d e   i s   c l o s e d   p a r t i a l l y   -   t h e   o r i g i n a l   t i c k e t   i s   g o n e   a n e   a   n e w   o n e   i s   c r e a t e d   a t   t h e   e n d 
 	 	 	 	 	 / /   T h a t ' s   w h y   w e   a r e   g o n n a   c h e c k   w h e t h e r   t h e   p a r e n t   o f   t h e   l a s t   t r a d e   i s   t h e   s a m e   a s   t h e   p r e v i o u s   t r a d e 
 	 	 	 	 	 c u r r e n t   =   c u r r e n t I t e m s [ c o u n t   -   1 ] ; 
 
 	 	 	 	 	 i f   ( p r e v i o u s . t i c k e t   = =   a t t r T i c k e t P a r e n t ( c u r r e n t . t i c k e t ) ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 i t e m   =   c u r r e n t ; 
 	 	 	 	 	 	 r e a s o n   =   " d e c r e m e n t " ; 
 	 	 	 	 	 } 
 	 	 	 	 	 e l s e 
 	 	 	 	 	 { 
 	 	 	 	 	 	 P r i n t ( " P o s i t i o n s   o r d e r   m i s m a t c h " ) ; 
 	 	 	 	 	 } 
 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 
 	 	 	 	 i f   ( p r e v i o u s . v o l u m e   ! =   c u r r e n t . v o l u m e ) 
 	 	 	 	 { 
 	 	 	 	 	 / /   V o l u m e   i n c r e m e n t 
 	 	 	 	 	 i f   ( p r e v i o u s . v o l u m e   <   c u r r e n t . v o l u m e ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 r e a s o n   =   " i n c r e m e n t " ; 
 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 } 
 	 	 	 	 	 / /   V o l u m e   d e c r e m e n t 
 	 	 	 	 	 e l s e 
 	 	 	 	 	 { 
 	 	 	 	 	 	 r e a s o n   =   " d e c r e m e n t " ; 
 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 / /   S L   &   T P   m o d i f i e d 
 	 	 	 	 i f   ( 
 	 	 	 	 	       p r e v i o u s . s t o p L o s s   ! =   c u r r e n t . s t o p L o s s 
 	 	 	 	 	 & &   p r e v i o u s . t a k e P r o f i t   ! =   c u r r e n t . t a k e P r o f i t 
 	 	 	 	 )   { 
 	 	 	 	 	 r e a s o n   =   " m o d i f y " ; 
 	 	 	 	 	 d e t a i l   =   " s l t p " ; 
 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 	 / /   S L   m o d i f i e d 
 	 	 	 	 e l s e   i f   ( p r e v i o u s . s t o p L o s s   ! =   c u r r e n t . s t o p L o s s ) 
 	 	 	 	 { 
 	 	 	 	 	 r e a s o n   =   " m o d i f y " ; 
 	 	 	 	 	 d e t a i l   =   " s l " ; 
 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 	 / /   T P   m o d i f i e d 
 	 	 	 	 e l s e   i f   ( p r e v i o u s . t a k e P r o f i t   ! =   c u r r e n t . t a k e P r o f i t ) 
 	 	 	 	 { 
 	 	 	 	 	 r e a s o n   =   " m o d i f y " ; 
 	 	 	 	 	 d e t a i l   =   " t p " ; 
 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 	 
 	 	 	 	 i f   ( p r e v i o u s . t i m e E x p i r a t i o n   ! =   c u r r e n t . t i m e E x p i r a t i o n ) 
 	 	 	 	 { 
 	 	 	 	 	 r e a s o n   =   " m o d i f y " ; 
 	 	 	 	 	 d e t a i l   =   " e x p i r a t i o n " ; 
 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 
 	 	 i f   ( r e a s o n   = =   " " ) 
 	 	 { 
 	 	 	 r e t u r n   f a l s e ; 
 	 	 } 
 
 	 	 U p d a t e V a l u e s ( i t e m ,   r e a s o n ,   d e t a i l ) ; 
 
 	 	 r e t u r n   t r u e ; 
 	 } 
 	 
 	 / * * 
 	 *   F r o m   t h e   l i s t   o f   p r e v i o u s   o r d e r s   o r   p o s i t i o n s ,   f i n d   t h e   i t e m   t h a t   i s   m i s s i n g 
 	 *   i n   t h e   l i s t   o f   c u r r e n t   o r d e r s   o r   p o s i t i o n s . 
 	 * 
 	 *   R e t u r n   t h e   t i c k e t   n u m b e r   o r   0   i f   n o t h i n g   i s   f o u n d . 
 	 * / 
 	 t e m p l a t e < t y p e n a m e   T >   
 	 T   F i n d M i s s i n g I t e m ( T   & p r e v i o u s [ ] ,   T   & c u r r e n t [ ] ) 
 	 { 
 	 	 i n t   p r e v i o u s C o u n t   =   A r r a y S i z e ( p r e v i o u s ) ; 
 	 	 i n t   c u r r e n t C o u n t     =   A r r a y S i z e ( c u r r e n t ) ; 
 	 	 T   i t e m ; 
 
 	 	 l o n g   t i c k e t   =   0 ; 
 
 	 	 f o r   ( i n t   i   =   0 ;   i   <   p r e v i o u s C o u n t ;   i + + ) 
 	 	 { 
 	 	 	 b o o l   f o u n d   =   f a l s e ; 
 
 	 	 	 f o r   ( i n t   j   =   0 ;   j   <   c u r r e n t C o u n t ;   j + + ) 
 	 	 	 { 
 	 	 	 	 i f   ( p r e v i o u s [ i ] . t i c k e t   = =   c u r r e n t [ j ] . t i c k e t ) 
 	 	 	 	 { 
 	 	 	 	 	 f o u n d   =   t r u e ; 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 i f   ( f o u n d   = =   f a l s e ) 
 	 	 	 { 
 	 	 	 	 i t e m   =   p r e v i o u s [ i ] ; 
 	 	 	 	 b r e a k ; 
 	 	 	 } 
 	 	 } 
 
 	 	 r e t u r n   i t e m ; 
 	 } 
 	 
 	 / * * 
 	 *   O v e r l o a d e d   m e t h o d   1   o f   2 
 	 * / 
 	 v o i d   U p d a t e V a l u e s ( P o s i t i o n   & i t e m ,   s t r i n g   r e a s o n ,   s t r i n g   d e t a i l ) 
 	 { 
 	 	 l o n g   t i c k e t                 =   i t e m . t i c k e t ; 
 	 	 d a t e t i m e   t i m e O p e n     =   i t e m . t i m e O p e n ; 
 	 	 d a t e t i m e   t i m e C l o s e   =   i t e m . t i m e C l o s e ; 
 	 	 d o u b l e   p r i c e O p e n       =   i t e m . p r i c e O p e n ; 
 	 	 d o u b l e   p r i c e C l o s e     =   i t e m . p r i c e C u r r e n t ; 
 	 	 d o u b l e   p r o f i t             =   i t e m . p r o f i t ; 
 	 	 d o u b l e   s w a p                 =   i t e m . s w a p ; 
 	 	 d o u b l e   c o m m i s s i o n     =   i t e m . c o m m i s s i o n ; 
 	 	 d o u b l e   v o l u m e             =   i t e m . v o l u m e ; 
 
 	 	 i f   ( r e a s o n   = =   " c l o s e "   | |   r e a s o n   = =   " d e c r e m e n t " ) 
 	 	 { 
 	 	 	 i f   ( O r d e r S e l e c t ( ( i n t ) t i c k e t ,   S E L E C T _ B Y _ T I C K E T ,   M O D E _ H I S T O R Y ) ) 
 	 	 	 { 
 	 	 	 	 t i m e O p e n       =   O r d e r O p e n T i m e ( ) ; 
 	 	 	 	 t i m e C l o s e     =   O r d e r C l o s e T i m e ( ) ; 
 	 	 	 	 p r i c e O p e n     =   O r d e r O p e n P r i c e ( ) ; 
 	 	 	 	 p r i c e C l o s e   =   O r d e r C l o s e P r i c e ( ) ; 
 	 	 	 	 p r o f i t           =   O r d e r P r o f i t ( ) ; 
 	 	 	 	 s w a p               =   O r d e r S w a p ( ) ; 
 	 	 	 	 c o m m i s s i o n   =   O r d e r C o m m i s s i o n ( ) ; 
 	 	 	 	 v o l u m e           =   O r d e r L o t s ( ) ; 
 
 	 	 	 	 i f   ( d e t a i l   = =   " " ) 
 	 	 	 	 { 
 	 	 	 	 	 i f   ( 
 	 	 	 	 	 	 i t e m . t i m e E x p i r a t i o n   >   0 
 	 	 	 	 	 	 & &   i t e m . t i m e E x p i r a t i o n   < =   t i m e C l o s e 
 	 	 	 	 	 )   { 
 	 	 	 	 	 	 d e t a i l   =   " e x p i r a t i o n " ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 
 	 	 	 	 i f   ( d e t a i l   = =   " " ) 
 	 	 	 	 { 
 	 	 	 	 	 s t r i n g   c o m m e n t   =   O r d e r C o m m e n t ( ) ; 
 
 	 	 	 	 	 / /   T r y   w i t h   c o m m e n t s ,   w h i c h   w o r k s   i n   t h e   T e s t e r ,   b u t   i t   c o u l d   n o t   w o r k   i n   r e a l 
 	 	 	 	 	           i f   ( c o m m e n t   = =   " [ t p ] " )   d e t a i l   =   " t p " ; 
 	 	 	 	 	 e l s e   i f   ( c o m m e n t   = =   " [ s l ] " )   d e t a i l   =   " s l " ; 
 
 	 	 	 	 	 / /   T r y   t o   d e t e c t   c l o s e   b y   S L   o r   T P   b y   t h e   c l o s e   p r i c e 
 	 	 	 	 	 i f   ( d e t a i l   = =   " " ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 i n t   t y p e   =   i t e m . t y p e ; 
 
 	 	 	 	 	 	 d o u b l e   s l   =   O r d e r S t o p L o s s ( ) ; 
 	 	 	 	 	 	 d o u b l e   t p   =   O r d e r T a k e P r o f i t ( ) ; 
 
 	 	 	 	 	 	 i f   ( t y p e   = =   0 )   / /   B U Y 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	           i f   ( s l   >   0   & &   p r i c e C l o s e   < =   s l )   d e t a i l   =   " s l " ; 
 	 	 	 	 	 	 	 e l s e   i f   ( t p   >   0   & &   p r i c e C l o s e   > =   t p )   d e t a i l   =   " t p " ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 	 e l s e   i f   ( t y p e   = =   1 )   / /   S E L L 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	           i f   ( s l   >   0   & &   p r i c e C l o s e   > =   s l )   d e t a i l   =   " s l " ; 
 	 	 	 	 	 	 	 e l s e   i f   ( t p   >   0   & &   p r i c e C l o s e   < =   t p )   d e t a i l   =   " t p " ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 
 	 	 i n t   i   =   e v e n t V a l u e s Q u e u e I n d e x ; 
 
 	 	 e v e n t V a l u e s [ i ] . r e a s o n   =   r e a s o n ; 
 	 	 e v e n t V a l u e s [ i ] . d e t a i l   =   d e t a i l ; 
   
 	 	 e v e n t V a l u e s [ i ] . p r i c e C l o s e           =   p r i c e C l o s e ; 
 	 	 e v e n t V a l u e s [ i ] . t i m e C l o s e             =   t i m e C l o s e ; 
 	 	 e v e n t V a l u e s [ i ] . c o m m e n t                 =   i t e m . c o m m e n t ; 
 	 	 e v e n t V a l u e s [ i ] . c o m m i s s i o n           =   c o m m i s s i o n ; 
 	 	 e v e n t V a l u e s [ i ] . t i m e E x p i r a t i o n   =   i t e m . t i m e E x p i r a t i o n ; 
 	 	 e v e n t V a l u e s [ i ] . v o l u m e                   =   v o l u m e ; 
 	 	 e v e n t V a l u e s [ i ] . m a g i c                     =   i t e m . m a g i c ; 
 	 	 e v e n t V a l u e s [ i ] . p r i c e O p e n             =   p r i c e O p e n ; 
 	 	 e v e n t V a l u e s [ i ] . t i m e O p e n               =   t i m e O p e n ; 
 	 	 e v e n t V a l u e s [ i ] . p r o f i t                   =   p r o f i t ; 
 	 	 e v e n t V a l u e s [ i ] . s t o p L o s s               =   i t e m . s t o p L o s s ; 
 	 	 e v e n t V a l u e s [ i ] . s w a p                       =   s w a p ; 
 	 	 e v e n t V a l u e s [ i ] . s y m b o l                   =   i t e m . s y m b o l ; 
 	 	 e v e n t V a l u e s [ i ] . t a k e P r o f i t           =   i t e m . t a k e P r o f i t ; 
 	 	 e v e n t V a l u e s [ i ] . t i c k e t                   =   t i c k e t ; 
 	 	 e v e n t V a l u e s [ i ] . t y p e                       =   i t e m . t y p e ; 
 
 	 	 i f   ( d e b u g ) 
 	 	 { 
 	 	 	 P r i n t U p d a t e d V a l u e s ( ) ; 
 	 	 } 
 	 } 
 	 
 	 / * * 
 	 *   O v e r l o a d e d   m e t h o d   2   o f   2 
 	 * / 
 	 v o i d   U p d a t e V a l u e s ( P e n d i n g O r d e r   & i t e m ,   s t r i n g   r e a s o n ,   s t r i n g   d e t a i l ) 
 	 { 
 	 	 i n t   i   =   e v e n t V a l u e s Q u e u e I n d e x ; 
 
 	 	 e v e n t V a l u e s [ i ] . r e a s o n   =   r e a s o n ; 
 	 	 e v e n t V a l u e s [ i ] . d e t a i l   =   d e t a i l ; 
 
 	 	 e v e n t V a l u e s [ i ] . p r i c e C l o s e           =   i t e m . p r i c e C u r r e n t ; 
 	 	 e v e n t V a l u e s [ i ] . t i m e C l o s e             =   i t e m . t i m e C l o s e ; 
 	 	 e v e n t V a l u e s [ i ] . c o m m e n t                 =   i t e m . c o m m e n t ; 
 	 	 e v e n t V a l u e s [ i ] . c o m m i s s i o n           =   0 . 0 ; 
 	 	 e v e n t V a l u e s [ i ] . t i m e E x p i r a t i o n   =   i t e m . t i m e E x p i r a t i o n ; 
 	 	 e v e n t V a l u e s [ i ] . v o l u m e                   =   i t e m . v o l u m e ; 
 	 	 e v e n t V a l u e s [ i ] . m a g i c                     =   i t e m . m a g i c ; 
 	 	 e v e n t V a l u e s [ i ] . p r i c e O p e n             =   i t e m . p r i c e O p e n ; 
 	 	 e v e n t V a l u e s [ i ] . t i m e O p e n               =   i t e m . t i m e O p e n ; 
 	 	 e v e n t V a l u e s [ i ] . p r o f i t                   =   0 . 0 ; 
 	 	 e v e n t V a l u e s [ i ] . s t o p L o s s               =   i t e m . s t o p L o s s ; 
 	 	 e v e n t V a l u e s [ i ] . s w a p                       =   0 . 0 ; 
 	 	 e v e n t V a l u e s [ i ] . s y m b o l                   =   i t e m . s y m b o l ; 
 	 	 e v e n t V a l u e s [ i ] . t a k e P r o f i t           =   i t e m . t a k e P r o f i t ; 
 	 	 e v e n t V a l u e s [ i ] . t i c k e t                   =   i t e m . t i c k e t ; 
 	 	 e v e n t V a l u e s [ i ] . t y p e                       =   i t e m . t y p e ; 
 
 	 	 i f   ( d e b u g ) 
 	 	 { 
 	 	 	 P r i n t U p d a t e d V a l u e s ( ) ; 
 	 	 } 
 	 } 
 
 	 v o i d   P r i n t U p d a t e d V a l u e s ( ) 
 	 { 
 	 	 P r i n t ( 
 	 	 	 "   < < < " 
 	 	 ) ; 
 	 	 
 	 	 P r i n t ( 
 	 	 	 "   |   r e a s o n :   " ,   e _ R e a s o n ( ) , 
 	 	 	 "   |   d e t a i l :   " ,   e _ R e a s o n D e t a i l ( ) , 
 	 	 	 "   |   t i c k e t :   " ,   e _ a t t r T i c k e t ( ) , 
 	 	 	 "   |   t y p e :   " ,   E n u m T o S t r i n g ( ( E N U M _ O R D E R _ T Y P E ) e _ a t t r T y p e ( ) ) 
 	 	 ) ; 
 	 	 
 	 	 P r i n t ( 
 	 	 	 "   |   o p e n T i m e   :   " ,   e _ a t t r O p e n T i m e ( ) , 
 	 	 	 "   |   o p e n P r i c e   :   " ,   e _ a t t r O p e n P r i c e ( ) 
 	 	 ) ; 
 	 	 
 	 	 P r i n t ( 
 	 	 	 "   |   c l o s e T i m e :   " ,   e _ a t t r C l o s e T i m e ( ) , 
 	 	 	 "   |   c l o s e P r i c e :   " ,   e _ a t t r C l o s e P r i c e ( ) 
 	 	 ) ; 
 	 	 
 	 	 P r i n t ( 
 	 	 	 "   |   v o l u m e :   " ,   e _ a t t r L o t s ( ) , 
 	 	 	 "   |   s l :   " ,   e _ a t t r S t o p L o s s ( ) , 
 	 	 	 "   |   t p :   " ,   e _ a t t r T a k e P r o f i t ( ) , 
 	 	 	 "   |   p r o f i t :   " ,   e _ a t t r P r o f i t ( ) , 
 	 	 	 "   |   s w a p :   " ,   e _ a t t r S w a p ( ) , 
 	 	 	 "   |   e x p :   " ,   e _ a t t r E x p i r a t i o n ( ) , 
 	 	 	 "   |   c o m m e n t :   " ,   e _ a t t r C o m m e n t ( ) 
 	 	 ) ; 
 	 	 
 	 	 P r i n t ( 
 	 	 	 " > > > " 
 	 	 ) ; 
 	 } 
 
 	 i n t   A d d E v e n t V a l u e s ( ) 
 	 { 
 	 	 e v e n t V a l u e s Q u e u e I n d e x + + ; 
 	 	 A r r a y R e s i z e ( e v e n t V a l u e s ,   e v e n t V a l u e s Q u e u e I n d e x   +   1 ) ; 
 
 	 	 r e t u r n   e v e n t V a l u e s Q u e u e I n d e x ; 
 	 } 
 
 	 i n t   R e m o v e E v e n t V a l u e s ( ) 
 	 { 
 	 	 i f   ( e v e n t V a l u e s Q u e u e I n d e x   = =   - 1 ) 
 	 	 { 
 	 	 	 P r i n t ( " C a n n o t   r e m o v e   e v e n t   v a l u e s ,   a d d   t h e m   f i r s t .   ( i n   f u n c t i o n   " ,   _ _ F U N C T I O N _ _ ,   " ) " ) ; 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 e v e n t V a l u e s Q u e u e I n d e x - - ; 
 	 	 	 A r r a y R e s i z e ( e v e n t V a l u e s ,   e v e n t V a l u e s Q u e u e I n d e x   +   1 ) ; 
 	 	 } 
 
 	 	 r e t u r n   e v e n t V a l u e s Q u e u e I n d e x ; 
 	 } 
 
 p u b l i c : 
 	 / * * 
 	 *   D e f a u l t   c o n s t r u c t o r 
 	 * / 
 	 O n T r a d e E v e n t D e t e c t o r ( v o i d ) 
 	 { 
 	 	 d e b u g   =   f a l s e ; 
 	 	 e v e n t V a l u e s Q u e u e I n d e x   =   - 1 ; 
 	 } ; 
 
 	 b o o l   S t a r t ( ) 
 	 { 
 	 	 A d d E v e n t V a l u e s ( ) ; 
 
 	 	 M a k e L i s t O f ( p o s i t i o n s ) ; 
 	 	 M a k e L i s t O f ( p e n d i n g O r d e r s ) ; 
 
 	 	 b o o l   s u c c e s s   =   f a l s e ; 
 
 	 	 i f   ( ! s u c c e s s )   s u c c e s s   =   D e t e c t E v e n t ( p r e v i o u s P o s i t i o n s ,   p o s i t i o n s ) ; 
 
 	 	 i f   ( ! s u c c e s s )   s u c c e s s   =   D e t e c t E v e n t ( p r e v i o u s P e n d i n g O r d e r s ,   p e n d i n g O r d e r s ) ; 
 
 	 	 C o p y L i s t ( p r e v i o u s P o s i t i o n s ,   p o s i t i o n s ) ; 
 	 	 C o p y L i s t ( p r e v i o u s P e n d i n g O r d e r s ,   p e n d i n g O r d e r s ) ; 
 
 	 	 r e t u r n   s u c c e s s ; 
 	 } 
 
 	 v o i d   E n d ( ) 
 	 { 
 	 	 R e m o v e E v e n t V a l u e s ( ) ; 
 	 } 
 
 	 s t r i n g   E v e n t V a l u e R e a s o n ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . r e a s o n ; } 
 	 s t r i n g   E v e n t V a l u e D e t a i l ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . d e t a i l ; } 
 
 	 i n t   E v e n t V a l u e T y p e ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . t y p e ; } 
 
 	 d a t e t i m e   E v e n t V a l u e T i m e C l o s e ( )             { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . t i m e C l o s e ; } 
 	 d a t e t i m e   E v e n t V a l u e T i m e O p e n ( )               { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . t i m e O p e n ; } 
 	 d a t e t i m e   E v e n t V a l u e T i m e E x p i r a t i o n ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . t i m e E x p i r a t i o n ; } 
 
 	 l o n g   E v e n t V a l u e M a g i c ( )     { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . m a g i c ; } 
 	 l o n g   E v e n t V a l u e T i c k e t ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . t i c k e t ; } 
 
 	 d o u b l e   E v e n t V a l u e C o m m i s s i o n ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . c o m m i s s i o n ; } 
 	 d o u b l e   E v e n t V a l u e P r i c e O p e n ( )     { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . p r i c e O p e n ; } 
 	 d o u b l e   E v e n t V a l u e P r i c e C l o s e ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . p r i c e C l o s e ; } 
 	 d o u b l e   E v e n t V a l u e P r o f i t ( )           { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . p r o f i t ; } 
 	 d o u b l e   E v e n t V a l u e S t o p L o s s ( )       { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . s t o p L o s s ; } 
 	 d o u b l e   E v e n t V a l u e S w a p ( )               { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . s w a p ; } 
 	 d o u b l e   E v e n t V a l u e T a k e P r o f i t ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . t a k e P r o f i t ; } 
 	 d o u b l e   E v e n t V a l u e V o l u m e ( )           { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . v o l u m e ; } 
 
 	 s t r i n g   E v e n t V a l u e C o m m e n t ( )   { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . c o m m e n t ; } 
 	 s t r i n g   E v e n t V a l u e S y m b o l ( )     { r e t u r n   e v e n t V a l u e s [ e v e n t V a l u e s Q u e u e I n d e x ] . s y m b o l ; } 
 } ; 
 
 O n T r a d e E v e n t D e t e c t o r   o n T r a d e E v e n t D e t e c t o r ;  
  
 i n t   O r d e r C r e a t e ( 
 	 s t r i n g       s y m b o l           =   " " , 
 	 i n t             t y p e               =   O P _ B U Y , 
 	 d o u b l e       l o t s               =   0 , 
 	 d o u b l e       o p                   =   0 , 
 	 d o u b l e       s l l                 =   0 ,   / /   S L   l e v e l 
 	 d o u b l e       t p l                 =   0 ,   / /   T O   l e v e l 
 	 d o u b l e       s l p                 =   0 ,   / /   S L   a d j u s t   i n   p o i n t s 
 	 d o u b l e       t p p                 =   0 ,   / /   T P   a d j u s t   i n   p o i n t s 
 	 d o u b l e       s l i p p a g e       =   0 , 
 	 i n t             m a g i c             =   0 , 
 	 s t r i n g       c o m m e n t         =   " " , 
 	 c o l o r         a r r o w c o l o r   =   C L R _ N O N E , 
 	 d a t e t i m e   e x p i r a t i o n   =   0 , 
 	 b o o l           o c o                 =   f a l s e 
 	 ) 
 { 
 	 u i n t   t i m e 0   =   G e t T i c k C o u n t ( ) ;   / /   u s e d   t o   m e a s u r e   s p e e d   o f   e x e c u t i o n   o f   t h e   o r d e r 
 
 	 i n t   t i c k e t   =   - 1 ; 
 	 b o o l   p l a c e E x p i r a t i o n O b j e c t   =   f a l s e ;   / /   w h e t h e r   o r   n o t   t o   c r e a t e   a n   o b j e c t   f o r   e x p i r a t i o n   f o r   t r a d e s 
 
 	 / /   c a l c u l a t e   b u y / s e l l   f l a g   ( 1   w h e n   B u y   o r   - 1   w h e n   S e l l ) 
 	 i n t   b s   =   1 ; 
 
 	 i f   ( 
 	 	       t y p e   = =   O P _ S E L L 
 	 	 | |   t y p e   = =   O P _ S E L L S T O P 
 	 	 | |   t y p e   = =   O P _ S E L L L I M I T 
 	 	 ) 
 	 { 
 	 	 b s   =   - 1 ; 
 	 } 
 
 	 i f   ( s y m b o l   = =   " " )   { s y m b o l   =   S y m b o l ( ) ; } 
 
 	 l o t s   =   A l i g n L o t s ( s y m b o l ,   l o t s ) ; 
 
 	 i n t   d i g i t s   =   0 ; 
 	 d o u b l e   a s k   =   0 ,   b i d   =   0 ,   p o i n t   =   0 ,   t i c k s i z e   =   0 ; 
 	 d o u b l e   s l   =   0 ,   t p   =   0 ; 
 	 d o u b l e   v s l   =   0 ,   v t p   =   0 ; 
 
 	 / / - -   a t t e m p t   t o   s e n d   t r a d e / o r d e r   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 w h i l e   ( ! I s S t o p p e d ( ) ) 
 	 { 
 	 	 W a i t T r a d e C o n t e x t I f B u s y ( ) ; 
 
 	 	 s t a t i c   b o o l   n o t _ a l l o w e d _ m e s s a g e   =   f a l s e ; 
 
 	 	 i f   ( 
 	 	 	       ! M Q L I n f o I n t e g e r ( M Q L _ T E S T E R ) 
 	 	 	 & &   ! M a r k e t I n f o ( s y m b o l ,   M O D E _ T R A D E A L L O W E D ) 
 	 	 )   { 
 	 	 	 i f   ( n o t _ a l l o w e d _ m e s s a g e   = =   f a l s e ) 
 	 	 	 { 
 	 	 	 	 P r i n t ( " M a r k e t   ( " + s y m b o l + " )   i s   c l o s e d " ) ; 
 	 	 	 } 
 
 	 	 	 n o t _ a l l o w e d _ m e s s a g e   =   t r u e ; 
 
 	 	 	 r e t u r n   f a l s e ; 
 	 	 } 
 
 	 	 n o t _ a l l o w e d _ m e s s a g e   =   f a l s e ; 
 
 	 	 d i g i t s       =   ( i n t ) M a r k e t I n f o ( s y m b o l ,   M O D E _ D I G I T S ) ; 
 	 	 a s k             =   M a r k e t I n f o ( s y m b o l ,   M O D E _ A S K ) ; 
 	 	 b i d             =   M a r k e t I n f o ( s y m b o l ,   M O D E _ B I D ) ; 
 	 	 p o i n t         =   M a r k e t I n f o ( s y m b o l ,   M O D E _ P O I N T ) ; 
 	 	 t i c k s i z e   =   M a r k e t I n f o ( s y m b o l ,   M O D E _ T I C K S I Z E ) ; 
 
 	 	 / / -   n o t   e n o u g h   m o n e y   c h e c k :   f i x   m a x i m u m   p o s s i b l e   l o t   b y   m a r g i n   r e q u i r e d ,   o r   q u i t 
 	 	 i f   ( t y p e = = O P _ B U Y   | |   t y p e = = O P _ S E L L ) 
 	 	 { 
 	 	 	 d o u b l e   L o t S t e p                     =   M a r k e t I n f o ( s y m b o l , M O D E _ L O T S T E P ) ; 
 	 	 	 d o u b l e   M i n L o t s                     =   M a r k e t I n f o ( s y m b o l , M O D E _ M I N L O T ) ; 
 	 	 	 d o u b l e   m a r g i n _ r e q u i r e d     =   M a r k e t I n f o ( s y m b o l , M O D E _ M A R G I N R E Q U I R E D ) ; 
 	 	 	 s t a t i c   b o o l   n o t _ e n o u g h _ m e s s a g e   =   f a l s e ; 
 
 	 	 	 i f   ( m a r g i n _ r e q u i r e d   ! =   0 ) 
 	 	 	 { 
 	 	 	 	 d o u b l e   m a x _ s i z e _ b y _ m a r g i n   =   A c c o u n t F r e e M a r g i n ( )   /   m a r g i n _ r e q u i r e d ; 
 
 	 	 	 	 i f   ( l o t s   >   m a x _ s i z e _ b y _ m a r g i n ) 
 	 	 	 	 { 
 	 	 	 	 	 d o u b l e   s i z e _ o l d   =   l o t s ; 
 	 	 	 	 	 l o t s   =   m a x _ s i z e _ b y _ m a r g i n ; 
 
 	 	 	 	 	 i f   ( l o t s   <   M i n L o t s ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 i f   ( n o t _ e n o u g h _ m e s s a g e   = =   f a l s e ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 P r i n t ( " N o t   e n o u g h   m o n e y   t o   t r a d e   : (   T h e   r o b o t   i s   s t i l l   w o r k i n g ,   w a i t i n g   f o r   s o m e   f u n d s   t o   a p p e a r . . . " ) ; 
 	 	 	 	 	 	 } 
 
 	 	 	 	 	 	 n o t _ e n o u g h _ m e s s a g e   =   t r u e ; 
 	 	 	 	 	 	 r e t u r n   f a l s e ; 
 	 	 	 	 	 } 
 	 	 	 	 	 e l s e 
 	 	 	 	 	 { 
 	 	 	 	 	 	 l o t s   =   M a t h F l o o r ( l o t s   /   L o t S t e p )   *   L o t S t e p ; 
 
 	 	 	 	 	 	 P r i n t ( " N o t   e n o u g h   m o n e y   t o   t r a d e   "   +   D o u b l e T o S t r i n g ( s i z e _ o l d ,   2 ) + " ,   t h e   v o l u m e   t o   t r a d e   w i l l   b e   t h e   m a x i m u m   p o s s i b l e   o f   "   +   D o u b l e T o S t r i n g ( l o t s ,   2 ) ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 n o t _ e n o u g h _ m e s s a g e   =   f a l s e ; 
 	 	 } 
 
 	 	 / /   f i x   t h e   c o m m e n t ,   b e c a u s e   i t   s e e m s   t h a t   t h e   c o m m e n t   i s   d e l e t e d   i f   i t s   l e n g h t   i s   >   3 1   s y m b o l s 
 	 	 i f   ( S t r i n g L e n ( c o m m e n t )   >   3 1 ) 
 	 	 { 
 	 	 	 c o m m e n t   =   S t r i n g S u b s t r ( c o m m e n t , 0 , 3 1 ) ; 
 	 	 } 
 
 	 	 / / -   e x p i r a t i o n   f o r   t r a d e s 
 	 	 i f   ( t y p e   = =   O P _ B U Y   | |   t y p e   = =   O P _ S E L L ) 
 	 	 { 
 	 	 	 i f   ( e x p i r a t i o n   >   0 ) 
 	 	 	 { 
 	 	 	 	 / / -   b o   b r o k e r ? 
 	 	 	 	 i f   ( 
 	 	 	 	 	       S t r i n g L e n ( s y m b o l )   >   6 
 	 	 	 	 	 & &   S t r i n g S u b s t r ( s y m b o l ,   S t r i n g L e n ( s y m b o l )   -   2 )   = =   " b o " 
 	 	 	 	 )   { 
 	 	 	 	 	 / / -   c o n v e r t   U N I X   t o   s e c o n d s 
 	 	 	 	 	 i f   ( e x p i r a t i o n   >   T i m e C u r r e n t ( ) - 1 0 0 )   { 
 	 	 	 	 	 	 e x p i r a t i o n   =   e x p i r a t i o n   -   T i m e C u r r e n t ( ) ; 
 	 	 	 	 	 } 
 
 	 	 	 	 	 c o m m e n t   =   " B O   e x p : "   +   ( s t r i n g ) e x p i r a t i o n ; 
 	 	 	 	 } 
 	 	 	 	 e l s e 
 	 	 	 	 { 
 	 	 	 	 	 / /   T h e   e x p i r a t i o n   i n   t h i s   c a s e   i s   a   v e r t i c a l   l i n e 
 	 	 	 	 	 / /   C o m m e n t   d o e s n ' t   a l w a y s   w o r k , 
 	 	 	 	 	 / /   b e c a u s e   i t   c h a n g e s   w h e n   t h e   t r a d e   i s   p a r t i a l l y   c l o s e d 
 	 	 	 	 	 p l a c e E x p i r a t i o n O b j e c t   =   t r u e ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 
 	 	 i f   ( t y p e   = =   O P _ B U Y   | |   t y p e   = =   O P _ S E L L ) 
 	 	 { 
 	 	 	 o p   =   ( b s   >   0 )   ?   a s k   :   b i d ; 
 	 	 } 
 
 	 	 o p     =   N o r m a l i z e D o u b l e ( o p ,   d i g i t s ) ; 
 	 	 s l l   =   N o r m a l i z e D o u b l e ( s l l ,   d i g i t s ) ; 
 	 	 t p l   =   N o r m a l i z e D o u b l e ( t p l ,   d i g i t s ) ; 
 
 	 	 i f   ( o p   <   0   | |   o p   > =   E M P T Y _ V A L U E   | |   s l l   <   0   | |   s l p   <   0   | |   t p l   <   0   | |   t p p   <   0 ) 
 	 	 { 
 	 	 	 b r e a k ; 
 	 	 } 
 
 	 	 / / - -   S L   a n d   T P   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 v s l   =   0 ;   v t p   =   0 ; 
 
 	 	 s l   =   A l i g n S t o p L o s s ( s y m b o l ,   t y p e ,   o p ,   0 ,   N o r m a l i z e D o u b l e ( s l l ,   d i g i t s ) ,   s l p ) ; 
 
 	 	 i f   ( s l   <   0 )   { b r e a k ; } 
 
 	 	 t p   =   A l i g n T a k e P r o f i t ( s y m b o l ,   t y p e ,   o p ,   0 ,   N o r m a l i z e D o u b l e ( t p l ,   d i g i t s ) ,   t p p ) ; 
 
 	 	 i f   ( t p   <   0 )   { b r e a k ; } 
 
 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 { 
 	 	 	 / / - -   v i r t u a l   S L   a n d   T P   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 	 v s l   =   s l ; 
 	 	 	 v t p   =   t p ; 
 	 	 	 s l   =   0 ; 
 	 	 	 t p   =   0 ; 
 
 	 	 	 d o u b l e   a s k b i d   =   ( b s   >   0 )   ?   a s k   :   b i d ; 
 
 	 	 	 i f   ( v s l   >   0   | |   U S E _ E M E R G E N C Y _ S T O P S   = =   " a l w a y s " ) 
 	 	 	 { 
 	 	 	 	 i f   ( E M E R G E N C Y _ S T O P S _ R E L   >   0   | |   E M E R G E N C Y _ S T O P S _ A D D   >   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 s l   =   v s l   -   E M E R G E N C Y _ S T O P S _ R E L   *   M a t h A b s ( a s k b i d   -   v s l )   *   b s ; 
 
 	 	 	 	 	 i f   ( s l   < =   0 )   { s l   =   a s k b i d ; } 
 
 	 	 	 	 	 s l   =   s l   -   t o D i g i t s ( E M E R G E N C Y _ S T O P S _ A D D ,   s y m b o l )   *   b s ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 i f   ( v t p   >   0   | |   U S E _ E M E R G E N C Y _ S T O P S   = =   " a l w a y s " ) 
 	 	 	 { 
 	 	 	 	 i f   ( E M E R G E N C Y _ S T O P S _ R E L   >   0   | |   E M E R G E N C Y _ S T O P S _ A D D   >   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 t p   =   v t p   +   E M E R G E N C Y _ S T O P S _ R E L   *   M a t h A b s ( v t p   -   a s k b i d )   *   b s ; 
 
 	 	 	 	 	 i f   ( t p   < =   0 )   { t p   =   a s k b i d ; } 
 
 	 	 	 	 	 t p   =   t p   +   t o D i g i t s ( E M E R G E N C Y _ S T O P S _ A D D ,   s y m b o l )   *   b s ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 v s l   =   N o r m a l i z e D o u b l e ( v s l ,   d i g i t s ) ; 
 	 	 	 v t p   =   N o r m a l i z e D o u b l e ( v t p ,   d i g i t s ) ; 
 	 	 } 
 
 	 	 s l   =   N o r m a l i z e D o u b l e ( s l ,   d i g i t s ) ; 
 	 	 t p   =   N o r m a l i z e D o u b l e ( t p ,   d i g i t s ) ; 
 
 	 	 / / - -   f i x   e x p i r a t i o n   f o r   p e n d i n g   o r d e r s   - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 i f   ( e x p i r a t i o n   >   0   & &   t y p e   >   O P _ S E L L ) 
 	 	 { 
 	 	 	 i f   ( ( e x p i r a t i o n   -   T i m e C u r r e n t ( ) )   <   ( 1 1   *   6 0 ) ) 
 	 	 	 { 
 	 	 	 	 P r i n t ( " E x p i r a t i o n   t i m e   c a n n o t   b e   l e s s   t h a n   1 1   m i n u t e s ,   s o   i t   w a s   a u t o m a t i c a l l y   m o d i f i e d   t o   1 1   m i n u t e s . " ) ; 
 	 	 	 	 e x p i r a t i o n   =   T i m e C u r r e n t ( )   +   ( 1 1   *   6 0 ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 / / - -   f i x   p r i c e s   b y   t i c k s i z e 
 	 	 o p   =   M a t h R o u n d ( o p   /   t i c k s i z e )   *   t i c k s i z e ; 
 	 	 s l   =   M a t h R o u n d ( s l   /   t i c k s i z e )   *   t i c k s i z e ; 
 	 	 t p   =   M a t h R o u n d ( t p   /   t i c k s i z e )   *   t i c k s i z e ; 
 
 	 	 / / - -   s e n d   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 R e s e t L a s t E r r o r ( ) ; 
 
 	 	 t i c k e t   =   O r d e r S e n d ( 
 	 	 	 s y m b o l , 
 	 	 	 t y p e , 
 	 	 	 l o t s , 
 	 	 	 o p , 
 	 	 	 ( i n t ) ( s l i p p a g e   *   P i p V a l u e ( s y m b o l ) ) , 
 	 	 	 s l , 
 	 	 	 t p , 
 	 	 	 c o m m e n t , 
 	 	 	 m a g i c , 
 	 	 	 e x p i r a t i o n , 
 	 	 	 a r r o w c o l o r 
 	 	 ) ; 
 
 	 	 / / - -   e r r o r   c h e c k   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 s t r i n g   m s g _ p r e f i x   =   ( t y p e   >   O P _ S E L L )   ?   " N e w   o r d e r   e r r o r "   :   " N e w   t r a d e   e r r o r " ; 
 
 	 	 i n t   e r r a c t i o n   =   C h e c k F o r T r a d i n g E r r o r ( G e t L a s t E r r o r ( ) ,   m s g _ p r e f i x ) ; 
 
 	 	 s w i t c h ( e r r a c t i o n ) 
 	 	 { 
 	 	 	 c a s e   0 :   b r e a k ;         / /   n o   e r r o r 
 	 	 	 c a s e   1 :   c o n t i n u e ;   / /   o v e r c o m a b l e   e r r o r 
 	 	 	 c a s e   2 :   b r e a k ;         / /   f a t a l   e r r o r 
 	 	 } 
 
 	 	 / / - -   f i n i s h   w o r k   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 i f   ( t i c k e t   >   0 ) 
 	 	 { 
 	 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 	 { 
 	 	 	 	 V i r t u a l S t o p s D r i v e r ( " s e t " ,   t i c k e t ,   v s l ,   v t p ,   t o P i p s ( M a t h A b s ( o p - v s l ) ,   s y m b o l ) ,   t o P i p s ( M a t h A b s ( v t p - o p ) ,   s y m b o l ) ) ; 
 	 	 	 } 
 
 	 	 	 / / - -   s h o w   s o m e   i n f o 
 	 	 	 d o u b l e   s l i p   =   0 ; 
 
 	 	 	 i f   ( O r d e r S e l e c t ( t i c k e t ,   S E L E C T _ B Y _ T I C K E T ) ) 
 	 	 	 { 
 	 	 	 	 i f   ( p l a c e E x p i r a t i o n O b j e c t ) 
 	 	 	 	 { 
 	 	 	 	 	 e x p i r a t i o n W o r k e r . S e t E x p i r a t i o n ( t i c k e t ,   e x p i r a t i o n ) ; 
 	 	 	 	 } 
 
 	 	 	 	 i f   ( 
 	 	 	 	 	       ! M Q L I n f o I n t e g e r ( M Q L _ T E S T E R ) 
 	 	 	 	 	 & &   ! M Q L I n f o I n t e g e r ( M Q L _ V I S U A L _ M O D E ) 
 	 	 	 	 	 & &   ! M Q L I n f o I n t e g e r ( M Q L _ O P T I M I Z A T I O N ) 
 	 	 	 	 )   { 
 	 	 	 	 	 s l i p   =   O r d e r O p e n P r i c e ( )   -   o p ; 
 
 	 	 	 	 	 P r i n t ( 
 	 	 	 	 	 	 " O p e r a t i o n   d e t a i l s :   S p e e d   " , 
 	 	 	 	 	 	 ( G e t T i c k C o u n t ( )   -   t i m e 0 ) , 
 	 	 	 	 	 	 "   m s   |   S l i p p a g e   " , 
 	 	 	 	 	 	 D o u b l e T o S t r ( t o P i p s ( s l i p ,   s y m b o l ) ,   1 ) , 
 	 	 	 	 	 	 "   p i p s " 
 	 	 	 	 	 ) ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 / / - -   f i x   s t o p s   i n   c a s e   o f   s l i p p a g e 
 	 	 	 i f   ( 
 	 	 	 	       ! M Q L I n f o I n t e g e r ( M Q L _ T E S T E R ) 
 	 	 	 	 & &   ! M Q L I n f o I n t e g e r ( M Q L _ V I S U A L _ M O D E ) 
 	 	 	 	 & & ! M Q L I n f o I n t e g e r ( M Q L _ O P T I M I Z A T I O N ) 
 	 	 	 )   { 
 	 	 	 	 s l i p   =   N o r m a l i z e D o u b l e ( O r d e r O p e n P r i c e ( ) ,   d i g i t s )   -   N o r m a l i z e D o u b l e ( o p ,   d i g i t s ) ; 
 
 	 	 	 	 i f   ( s l i p   ! =   0   & &   ( O r d e r S t o p L o s s ( )   ! =   0   | |   O r d e r T a k e P r o f i t ( )   ! =   0 ) ) 
 	 	 	 	 { 
 	 	 	 	 	 P r i n t ( " C o r r e c t i n g   s t o p s   b e c a u s e   o f   s l i p p a g e . . . " ) ; 
 
 	 	 	 	 	 s l   =   O r d e r S t o p L o s s ( ) ; 
 	 	 	 	 	 t p   =   O r d e r T a k e P r o f i t ( ) ; 
 
 	 	 	 	 	 i f   ( s l   ! =   0   | |   t p   ! =   0 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 i f   ( s l   ! =   0 )   { s l   =   N o r m a l i z e D o u b l e ( O r d e r S t o p L o s s ( )   +   s l i p ,   d i g i t s ) ; } 
 	 	 	 	 	 	 i f   ( t p   ! =   0 )   { t p   =   N o r m a l i z e D o u b l e ( O r d e r T a k e P r o f i t ( )   +   s l i p ,   d i g i t s ) ; } 
 
 	 	 	 	 	 	 M o d i f y O r d e r ( t i c k e t ,   O r d e r O p e n P r i c e ( ) ,   s l ,   t p ,   0 ,   0 ,   0 ,   C L R _ N O N E ,   f a l s e ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 O n T r a d e ( ) ; 
 
 	 	 	 b r e a k ; 
 	 	 } 
 
 	 	 b r e a k ; 
 	 } 
 
 	 i f   ( o c o   = =   t r u e   & &   t i c k e t   >   0 ) 
 	 { 
 	 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 	 { 
 	 	 	 s l   =   v s l ; 
 	 	 	 t p   =   v t p ; 
 	 	 } 
 
 	 	 s l   =   ( s l   >   0 )   ?   N o r m a l i z e D o u b l e ( M a t h A b s ( o p - s l ) ,   d i g i t s )   :   0 ; 
 	 	 t p   =   ( t p   >   0 )   ?   N o r m a l i z e D o u b l e ( M a t h A b s ( o p - t p ) ,   d i g i t s )   :   0 ; 
 
 	 	 i n t   t y p e o c o   =   t y p e ; 
 
 	 	 i f   ( t y p e o c o   = =   O P _ B U Y S T O P ) 
 	 	 { 
 	 	 	 t y p e o c o   =   O P _ S E L L S T O P ; 
 	 	 	 o p   =   b i d   -   M a t h A b s ( o p   -   a s k ) ; 
 	 	 } 
 	 	 e l s e   i f   ( t y p e o c o   = =   O P _ B U Y L I M I T ) 
 	 	 { 
 	 	 	 t y p e o c o   =   O P _ S E L L L I M I T ; 
 	 	 	 o p   =   b i d   +   M a t h A b s ( o p   -   a s k ) ; 
 	 	 } 
 	 	 e l s e   i f   ( t y p e o c o   = =   O P _ S E L L S T O P ) 
 	 	 { 
 	 	 	 t y p e o c o   =   O P _ B U Y S T O P ; 
 	 	 	 o p   =   a s k   +   M a t h A b s ( o p   -   b i d ) ; 
 	 	 } 
 	 	 e l s e   i f   ( t y p e o c o   = =   O P _ S E L L L I M I T ) 
 	 	 { 
 	 	 	 t y p e o c o   =   O P _ B U Y L I M I T ; 
 	 	 	 o p   =   a s k   -   M a t h A b s ( o p   -   b i d ) ; 
 	 	 } 
 
 	 	 i f   ( t y p e o c o   = =   O P _ B U Y S T O P   | |   t y p e o c o   = =   O P _ B U Y L I M I T ) 
 	 	 { 
 	 	 	 s l   =   ( s l   >   0 )   ?   o p   -   s l   :   0 ; 
 	 	 	 t p   =   ( t p   >   0 )   ?   o p   +   t p   :   0 ; 
 	 	 	 a r r o w c o l o r   =   c l r B l u e ; 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 s l   =   ( s l   >   0 )   ?   o p   +   s l   :   0 ; 
 	 	 	 t p   =   ( t p   >   0 )   ?   o p   -   t p   :   0 ; 
 	 	 	 a r r o w c o l o r   =   c l r R e d ; 
 	 	 } 
 
 	 	 c o m m e n t   =   " [ o c o : "   +   ( s t r i n g ) t i c k e t   +   " ] " ; 
 
 	 	 O r d e r C r e a t e ( s y m b o l ,   t y p e o c o ,   l o t s ,   o p ,   s l ,   t p ,   0 ,   0 ,   s l i p p a g e ,   m a g i c ,   c o m m e n t ,   a r r o w c o l o r ,   e x p i r a t i o n ,   f a l s e ) ; 
 	 } 
 
 	 r e t u r n   t i c k e t ; 
 }  
  
 / * * 
 *   T h i s   i s   a   r e p l a c e m e n t   f o r   t h e   s y s t e m   f u n c t i o n . 
 *   T h e   d i f f e r e n c e   i s   t h a t   t h i s   c a n   a l s o   g e t   t h e   e x p i r a t i o n   f o r   t r a d e s . 
 * / 
 d a t e t i m e   O r d e r E x p i r a t i o n ( b o o l   c h e c k _ t r a d e ) 
 { 
 	 d a t e t i m e   e x p i r a t i o n   =   ( d a t e t i m e ) 0 ; 
 
 	 i f   ( O r d e r T y p e ( )   >   O P _ S E L L ) 
 	 { 
 	 	 e x p i r a t i o n   =   O r d e r E x p i r a t i o n ( ) ; 
 	 } 
 	 e l s e   i f   ( c h e c k _ t r a d e ) 
 	 { 
 	 	 e x p i r a t i o n   =   ( d a t e t i m e ) e x p i r a t i o n W o r k e r . G e t E x p i r a t i o n ( O r d e r T i c k e t ( ) ) ; 
 	 } 
 
 	 r e t u r n   e x p i r a t i o n ; 
 }  
  
 / * * 
 *   T h i s   i s   a   r e p l a c e m e n t   f o r   t h e   s y s t e m   f u n c t i o n . 
 *   T h e   d i f f e r e n c e   i s   t h a t   t h i s   c a n   a l s o   g e t   t h e   e x p i r a t i o n   f o r   t r a d e s . 
 * / 
 d a t e t i m e   O r d e r E x p i r a t i o n T i m e ( ) 
 { 
 	 d a t e t i m e   e x p i r a t i o n   =   ( d a t e t i m e ) 0 ; 
 
 	 i f   ( O r d e r T y p e ( )   >   O P _ S E L L ) 
 	 { 
 	 	 e x p i r a t i o n   =   O r d e r E x p i r a t i o n ( ) ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 e x p i r a t i o n   =   ( d a t e t i m e ) e x p i r a t i o n W o r k e r . G e t E x p i r a t i o n ( O r d e r T i c k e t ( ) ) ; 
 	 } 
 
 	 r e t u r n   e x p i r a t i o n ; 
 }  
  
 b o o l   O r d e r M o d i f i e d ( u l o n g   t i c k e t   =   0 ,   s t r i n g   a c t i o n   =   " s e t " ) 
 { 
 	 s t a t i c   u l o n g   m e m o r y [ ] ; 
 
 	 i f   ( t i c k e t   = =   0 ) 
 	 { 
 	 	 t i c k e t   =   O r d e r T i c k e t ( ) ; 
 	 	 a c t i o n   =   " g e t " ; 
 	 } 
 	 e l s e   i f   ( t i c k e t   >   0   & &   a c t i o n   ! =   " c l e a r " ) 
 	 { 
 	 	 a c t i o n   =   " s e t " ; 
 	 } 
 
 	 b o o l   m o d i f i e d _ s t a t u s   =   I n A r r a y ( m e m o r y ,   t i c k e t ) ; 
 	 
 	 i f   ( a c t i o n   = =   " g e t " ) 
 	 { 
 	 	 r e t u r n   m o d i f i e d _ s t a t u s ; 
 	 } 
 	 e l s e   i f   ( a c t i o n   = =   " s e t " ) 
 	 { 
 	 	 A r r a y E n s u r e V a l u e ( m e m o r y ,   t i c k e t ) ; 
 
 	 	 r e t u r n   t r u e ; 
 	 } 
 	 e l s e   i f   ( a c t i o n   = =   " c l e a r " ) 
 	 { 
 	 	 A r r a y S t r i p V a l u e ( m e m o r y ,   t i c k e t ) ; 
 
 	 	 r e t u r n   t r u e ; 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 b o o l   P e n d i n g O r d e r S e l e c t B y T i c k e t ( u l o n g   t i c k e t ) 
 { 
 	 i f   ( O r d e r S e l e c t ( ( i n t ) t i c k e t ,   S E L E C T _ B Y _ T I C K E T ,   M O D E _ T R A D E S )   & &   O r d e r T y p e ( )   >   1 ) 
 	 { 
 	 	 r e t u r n   t r u e ; 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 d o u b l e   P i p V a l u e ( s t r i n g   s y m b o l ) 
 { 
 	 i f   ( s y m b o l   = =   " " )   s y m b o l   =   S y m b o l ( ) ; 
 
 	 r e t u r n   C u s t o m P o i n t ( s y m b o l )   /   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ; 
 }  
  
 i n t   S e c o n d s F r o m C o m p o n e n t s ( d o u b l e   d a y s ,   d o u b l e   h o u r s ,   d o u b l e   m i n u t e s ,   i n t   s e c o n d s ) 
 { 
 	 i n t   r e t v a l   = 
 	 	 8 6 4 0 0   *   ( i n t ) M a t h F l o o r ( d a y s ) 
 	 	 +   3 6 0 0   *   ( i n t ) ( M a t h F l o o r ( h o u r s )   +   ( 2 4   *   ( d a y s   -   M a t h F l o o r ( d a y s ) ) ) ) 
 	 	 +   6 0   *   ( i n t ) ( M a t h F l o o r ( m i n u t e s )   +   ( 6 0   *   ( h o u r s   -   M a t h F l o o r ( h o u r s ) ) ) ) 
 	 	 +   ( i n t ) ( ( d o u b l e ) s e c o n d s   +   ( 6 0   *   ( m i n u t e s   -   M a t h F l o o r ( m i n u t e s ) ) ) ) ; 
 
 	 r e t u r n   r e t v a l ; 
 }  
  
 i n t   S e l l N o w ( 
 	 s t r i n g   s y m b o l , 
 	 d o u b l e   l o t s , 
 	 d o u b l e   s l l , 
 	 d o u b l e   t p l , 
 	 d o u b l e   s l p , 
 	 d o u b l e   t p p , 
 	 d o u b l e   s l i p p a g e   =   0 , 
 	 i n t   m a g i c   =   0 , 
 	 s t r i n g   c o m m e n t   =   " " , 
 	 c o l o r   a r r o w c o l o r   =   c l r N O N E , 
 	 d a t e t i m e   e x p i r a t i o n   =   0 
 	 ) 
 { 
 	 r e t u r n   O r d e r C r e a t e ( 
 	 	 s y m b o l , 
 	 	 O P _ S E L L , 
 	 	 l o t s , 
 	 	 0 , 
 	 	 s l l , 
 	 	 t p l , 
 	 	 s l p , 
 	 	 t p p , 
 	 	 s l i p p a g e , 
 	 	 m a g i c , 
 	 	 c o m m e n t , 
 	 	 a r r o w c o l o r , 
 	 	 e x p i r a t i o n 
 	 ) ; 
 }  
  
 b o o l   S k i p T h e P a s s ( b o o l   s e t = f a l s e )  
 {  
       s t a t i c   i n t   m e m _ f i d = 0 ;  
       s t a t i c   b o o l   m e m = f a l s e ;  
       i f   ( s e t = = t r u e )   {  
             m e m = t r u e ;  
             m e m _ f i d = F X D _ C U R R E N T _ F U N C T I O N _ I D ;  
       }  
       e l s e   {  
             i f   ( m e m _ f i d ! = F X D _ C U R R E N T _ F U N C T I O N _ I D )   {  
                   m e m = f a l s e ;   / /   r e s e t  
                   r e t u r n ( f a l s e ) ;  
             }  
             i f   ( m e m = = t r u e )   {  
                   m e m = f a l s e ;   / /   r e s e t  
                   r e t u r n ( t r u e ) ;  
             }  
       }  
       r e t u r n ( m e m ) ;  
 }  
  
 t e m p l a t e < t y p e n a m e   T > 
 v o i d   S t r i n g E x p l o d e ( s t r i n g   d e l i m i t e r ,   s t r i n g   i n p u t S t r i n g ,   T   & o u t p u t [ ] ) 
 { 
 	 i n t   b e g i n       =   0 ; 
 	 i n t   e n d           =   0 ; 
 	 i n t   e l e m e n t   =   0 ; 
 	 i n t   l e n g t h     =   S t r i n g L e n ( i n p u t S t r i n g ) ; 
 	 i n t   l e n g t h _ d e l i m i t e r   =   S t r i n g L e n ( d e l i m i t e r ) ; 
 	 T   e m p t y _ v a l     =   ( t y p e n a m e ( T )   = =   " s t r i n g " )   ?   ( T ) " "   :   ( T ) 0 ; 
 
 	 i f   ( l e n g t h   >   0 ) 
 	 { 
 	 	 w h i l e   ( t r u e ) 
 	 	 { 
 	 	 	 e n d   =   S t r i n g F i n d ( i n p u t S t r i n g ,   d e l i m i t e r ,   b e g i n ) ; 
 
 	 	 	 A r r a y R e s i z e ( o u t p u t ,   e l e m e n t   +   1 ) ; 
 	 	 	 o u t p u t [ e l e m e n t ]   =   e m p t y _ v a l ; 
 	 
 	 	 	 i f   ( e n d   ! =   - 1 ) 
 	 	 	 { 
 	 	 	 	 i f   ( e n d   >   b e g i n ) 
 	 	 	 	 { 
 	 	 	 	 	 o u t p u t [ e l e m e n t ]   =   ( T ) S t r i n g S u b s t r ( i n p u t S t r i n g ,   b e g i n ,   e n d   -   b e g i n ) ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 o u t p u t [ e l e m e n t ]   =   ( T ) S t r i n g S u b s t r ( i n p u t S t r i n g ,   b e g i n ,   l e n g t h   -   b e g i n ) ; 
 	 	 	 	 b r e a k ; 
 	 	 	 } 
 	 	 	 
 	 	 	 b e g i n   =   e n d   +   1   +   ( l e n g t h _ d e l i m i t e r   -   1 ) ; 
 	 	 	 e l e m e n t + + ; 
 	 	 } 
 	 } 
 	 e l s e 
 	 { 
 	 	 A r r a y R e s i z e ( o u t p u t ,   1 ) ; 
 	 	 o u t p u t [ e l e m e n t ]   =   e m p t y _ v a l ; 
 	 } 
 }  
  
 t e m p l a t e < t y p e n a m e   T > 
 s t r i n g   S t r i n g I m p l o d e ( s t r i n g   d e l i m e t e r ,   T   & a r r a y [ ] ) 
 { 
       s t r i n g   r e t v a l   =   " " ; 
       i n t   s i z e             =   A r r a y S i z e ( a r r a y ) ; 
 
       f o r   ( i n t   i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 { 
             r e t v a l   =   S t r i n g C o n c a t e n a t e ( r e t v a l ,   ( s t r i n g ) a r r a y [ i ] ,   d e l i m e t e r ) ; 
       } 
 	 
       r e t u r n   S t r i n g S u b s t r ( r e t v a l ,   0 ,   ( S t r i n g L e n ( r e t v a l )   -   S t r i n g L e n ( d e l i m e t e r ) ) ) ; 
 }  
  
 d a t e t i m e   S t r i n g T o T i m e E x ( s t r i n g   s t r ,   s t r i n g   m o d e = " s e r v e r " ) 
 { 
 	 / /   m o d e :   s e r v e r ,   l o c a l ,   g m t 
 	 i f   ( S t r i n g F i n d ( s t r ,   "   " )   ! =   - 1 )   { 
 	       r e t u r n   S t r i n g T o T i m e ( s t r ) ; 
 	 } 
 	 
 	 d a t e t i m e   n o w   =   0 ; 
 	 d a t e t i m e   r e t v a l   =   0 ; 
 	 
 	 i f   ( m o d e   = =   " s e r v e r " )   { n o w   =   T i m e C u r r e n t ( ) ; } 
 	 e l s e   i f   ( m o d e   = =   " l o c a l " )   { n o w   =   T i m e L o c a l ( ) ; } 
 	 e l s e   i f   ( m o d e   = =   " g m t " )   { n o w   =   T i m e G M T ( ) ; } 
 	 
 	 r e t u r n   S t r i n g T o T i m e ( ( s t r i n g ) T i m e Y e a r ( n o w ) + " . " + ( s t r i n g ) T i m e M o n t h ( n o w ) + " . " + ( s t r i n g ) T i m e D a y ( n o w ) + "   " + s t r ) ; 
 }  
  
 s t r i n g   S t r i n g T r i m ( s t r i n g   t e x t ) 
 { 
       t e x t   =   S t r i n g T r i m R i g h t ( t e x t ) ; 
       t e x t   =   S t r i n g T r i m L e f t ( t e x t ) ; 
 	 
 	 r e t u r n   t e x t ; 
 }  
  
 d o u b l e   S y m b o l A s k ( s t r i n g   s y m b o l ) 
 { 
 	 i f   ( s y m b o l   = =   " " )   s y m b o l   =   S y m b o l ( ) ; 
 
 	 r e t u r n   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 }  
  
 d o u b l e   S y m b o l B i d ( s t r i n g   s y m b o l ) 
 { 
 	 i f   ( s y m b o l   = =   " " )   s y m b o l   =   S y m b o l ( ) ; 
 
 	 r e t u r n   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ; 
 }  
  
 i n t   S y m b o l D i g i t s ( s t r i n g   s y m b o l ) 
 { 
 	 i f   ( s y m b o l   = =   " " )   s y m b o l   =   S y m b o l ( ) ; 
 
 	 r e t u r n   ( i n t ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ D I G I T S ) ; 
 }  
  
 d o u b l e   T i c k s D a t a ( s t r i n g   s y m b o l   =   " " ,   i n t   t y p e   =   0 ,   i n t   s h i f t   =   0 ) 
 { 
 	 s t a t i c   b o o l   c o l l e c t i n g _ t i c k s   =   f a l s e ; 
 	 s t a t i c   s t r i n g   s y m b o l s [ ] ; 
 	 s t a t i c   i n t   z e r o _ s i d [ ] ; 
 	 s t a t i c   d o u b l e   m e m o r y A S K [ ] [ 1 0 0 ] ; 
 	 s t a t i c   d o u b l e   m e m o r y B I D [ ] [ 1 0 0 ] ; 
 
 	 i n t   s i d   =   0 ,   s i z e   =   0 ,   i   =   0 ,   i d   =   0 ; 
 	 d o u b l e   a s k   =   0 ,   b i d   =   0 ,   r e t v a l   =   0 ; 
 	 b o o l   e x i s t s   =   f a l s e ; 
 
 	 i f   ( A r r a y S i z e ( s y m b o l s )   = =   0 ) 
 	 { 
 	 	 A r r a y R e s i z e ( s y m b o l s ,   1 ) ; 
 	 	 A r r a y R e s i z e ( z e r o _ s i d ,   1 ) ; 
 	 	 A r r a y R e s i z e ( m e m o r y A S K ,   1 ) ; 
 	 	 A r r a y R e s i z e ( m e m o r y B I D ,   1 ) ; 
 
 	 	 s y m b o l s [ 0 ]   =   _ S y m b o l ; 
 	 } 
 
 	 i f   ( t y p e   >   0   & &   s h i f t   >   0 ) 
 	 { 
 	 	 c o l l e c t i n g _ t i c k s   =   t r u e ; 
 	 } 
 
 	 i f   ( c o l l e c t i n g _ t i c k s   = =   f a l s e ) 
 	 { 
 	 	 i f   ( t y p e   >   0   & &   s h i f t   = =   0 ) 
 	 	 { 
 	 	 	 / /   g o i n g   t o   g e t   t i c k s 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 r e t u r n   0 ; 
 	 	 } 
 	 } 
 
 	 i f   ( s y m b o l   = =   " " )   s y m b o l   =   _ S y m b o l ; 
 
 	 i f   ( t y p e   = =   0 ) 
 	 { 
 	 	 e x i s t s   =   f a l s e ; 
 	 	 s i z e       =   A r r a y S i z e ( s y m b o l s ) ; 
 
 	 	 i f   ( s i z e   = =   0 )   { A r r a y R e s i z e ( s y m b o l s ,   1 ) ; } 
 
 	 	 f o r   ( i = 0 ;   i < s i z e ;   i + + ) 
 	 	 { 
 	 	 	 i f   ( s y m b o l s [ i ]   = =   s y m b o l ) 
 	 	 	 { 
 	 	 	 	 e x i s t s   =   t r u e ; 
 	 	 	 	 s i d         =   i ; 
 	 	 	 	 b r e a k ; 
 	 	 	 } 
 	 	 } 
 
 	 	 i f   ( e x i s t s   = =   f a l s e ) 
 	 	 { 
 	 	 	 i n t   n e w s i z e   =   A r r a y S i z e ( s y m b o l s )   +   1 ; 
 
 	 	 	 A r r a y R e s i z e ( s y m b o l s ,   n e w s i z e ) ; 
 	 	 	 s y m b o l s [ n e w s i z e - 1 ]   =   s y m b o l ; 
 
 	 	 	 A r r a y R e s i z e ( z e r o _ s i d ,   n e w s i z e ) ; 
 	 	 	 A r r a y R e s i z e ( m e m o r y A S K ,   n e w s i z e ) ; 
 	 	 	 A r r a y R e s i z e ( m e m o r y B I D ,   n e w s i z e ) ; 
 
 	 	 	 s i d = n e w s i z e ; 
 	 	 } 
 
 	 	 i f   ( s i d   > =   0 ) 
 	 	 { 
 	 	 	 a s k   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 	 	 	 b i d   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ; 
 
 	 	 	 i f   ( b i d   = =   0   & &   M Q L I n f o I n t e g e r ( M Q L _ T E S T E R ) ) 
 	 	 	 { 
 	 	 	 	 P r i n t ( " T i c k s   d a t a   c o l l e c t o r   e r r o r :   "   +   s y m b o l   +   "   c a n n o t   b e   b a c k t e s t e d .   O n l y   t h e   c u r r e n t   s y m b o l   c a n   b e   b a c k t e s t e d .   T h e   E A   w i l l   b e   t e r m i n a t e d . " ) ; 
 	 	 	 	 E x p e r t R e m o v e ( ) ; 
 	 	 	 } 
 
 	 	 	 i f   ( 
 	 	 	 	       s y m b o l   = =   _ S y m b o l 
 	 	 	 	 | |   a s k   ! =   m e m o r y A S K [ s i d ] [ 0 ] 
 	 	 	 	 | |   b i d   ! =   m e m o r y B I D [ s i d ] [ 0 ] 
 	 	 	 ) 
 	 	 	 { 
 	 	 	 	 m e m o r y A S K [ s i d ] [ z e r o _ s i d [ s i d ] ]   =   a s k ; 
 	 	 	 	 m e m o r y B I D [ s i d ] [ z e r o _ s i d [ s i d ] ]   =   b i d ; 
 	 	 	 	 z e r o _ s i d [ s i d ]                                   =   z e r o _ s i d [ s i d ]   +   1 ; 
 
 	 	 	 	 i f   ( z e r o _ s i d [ s i d ]   = =   1 0 0 ) 
 	 	 	 	 { 
 	 	 	 	 	 z e r o _ s i d [ s i d ]   =   0 ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( s h i f t   < =   0 ) 
 	 	 { 
 	 	 	 i f   ( t y p e   = =   S Y M B O L _ A S K ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 	 	 	 } 
 	 	 	 e l s e   i f   ( t y p e   = =   S Y M B O L _ B I D ) 
 	 	 	 { 
 	 	 	 	 r e t u r n   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ;   
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 d o u b l e   m i d   =   ( ( S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K )   +   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) )   /   2 ) ; 
 
 	 	 	 	 r e t u r n   m i d ; 
 	 	 	 } 
 	 	 } 
 	 	 e l s e 
 	 	 { 
 	 	 	 s i z e   =   A r r a y S i z e ( s y m b o l s ) ; 
 
 	 	 	 f o r   ( i   =   0 ;   i   <   s i z e ;   i + + ) 
 	 	 	 { 
 	 	 	 	 i f   ( s y m b o l s [ i ]   = =   s y m b o l ) 
 	 	 	 	 { 
 	 	 	 	 	 s i d   =   i ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 i f   ( s h i f t   <   1 0 0 ) 
 	 	 	 { 
 	 	 	 	 i d   =   z e r o _ s i d [ s i d ]   -   s h i f t   -   1 ; 
 
 	 	 	 	 i f ( i d   <   0 )   { i d   =   i d   +   1 0 0 ; } 
 
 	 	 	 	 i f   ( t y p e   = =   S Y M B O L _ A S K ) 
 	 	 	 	 { 
 	 	 	 	 	 r e t v a l   =   m e m o r y A S K [ s i d ] [ i d ] ; 
 
 	 	 	 	 	 i f   ( r e t v a l   = =   0 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 r e t v a l   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 	 e l s e   i f   ( t y p e   = =   S Y M B O L _ B I D ) 
 	 	 	 	 { 
 	 	 	 	 	 r e t v a l   =   m e m o r y B I D [ s i d ] [ i d ] ; 
 
 	 	 	 	 	 i f   ( r e t v a l   = =   0 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 r e t v a l   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 } 
 
 	 r e t u r n   r e t v a l ; 
 }  
  
 i n t   T i c k s P e r S e c o n d ( b o o l   g e t _ m a x   =   f a l s e ,   b o o l   s e t   =   f a l s e ) 
 { 
 	 s t a t i c   d a t e t i m e   t i m e 0   =   0 ; 
 	 s t a t i c   i n t   t i c k s             =   0 ; 
 	 s t a t i c   i n t   t p s                 =   0 ; 
 	 s t a t i c   i n t   t p s m a x           =   0 ; 
 
 	 d a t e t i m e   t i m e 1   =   T i m e L o c a l ( ) ; 
 
 	 i f   ( s e t   = =   t r u e ) 
 	 { 
 	 	 i f   ( t i m e 1   >   t i m e 0 ) 
 	 	 { 
 	 	 	 i f   ( t i m e 1   -   t i m e 0   >   1 ) 
 	 	 	 { 
 	 	 	 	 t p s   =   0 ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 t p s   =   t i c k s ; 
 	 	 	 } 
 
 	 	 	 t i m e 0   =   t i m e 1 ; 
 	 	 	 t i c k s   =   0 ; 
 	 	 } 
 
 	 	 t i c k s + + ; 
 
 	 	 i f   ( t p s   >   t p s m a x )   { t p s m a x   =   t p s ; } 
 	 } 
 
 	 i f   ( g e t _ m a x ) 
 	 { 
 	 	 r e t u r n   t p s m a x ; 
 	 } 
 
 	 r e t u r n   t p s ; 
 }  
  
 d a t e t i m e   T i m e A t S t a r t ( s t r i n g   c m d   =   " s e r v e r " ) 
 { 
 	 s t a t i c   d a t e t i m e   l o c a l     =   0 ; 
 	 s t a t i c   d a t e t i m e   s e r v e r   =   0 ; 
 
 	 i f   ( c m d   = =   " l o c a l " ) 
 	 { 
 	 	 r e t u r n   l o c a l ; 
 	 } 
 	 e l s e   i f   ( c m d   = =   " s e r v e r " ) 
 	 { 
 	 	 r e t u r n   s e r v e r ; 
 	 } 
 	 e l s e   i f   ( c m d   = =   " s e t " ) 
 	 { 
 	 	 l o c a l     =   T i m e L o c a l ( ) ; 
 	 	 s e r v e r   =   T i m e C u r r e n t ( ) ; 
 	 } 
 
 	 r e t u r n   0 ; 
 }  
  
 d a t e t i m e   T i m e F r o m C o m p o n e n t s ( 
 	 i n t   t i m e _ s r c   =   0 , 
 	 i n t         y   =   0 , 
 	 i n t         m   =   0 , 
 	 d o u b l e   d   =   0 , 
 	 d o u b l e   h   =   0 , 
 	 d o u b l e   i   =   0 , 
 	 i n t         s   =   0 
 )   { 
 	 M q l D a t e T i m e   t m ; 
 
 	           i f   ( t i m e _ s r c   = =   0 )   { T i m e C u r r e n t ( t m ) ; } 
 	 e l s e   i f   ( t i m e _ s r c   = =   1 )   { T i m e L o c a l ( t m ) ; } 
 	 e l s e   i f   ( t i m e _ s r c   = =   2 )   { T i m e G M T ( t m ) ; } 
 
 	 i f   ( y   >   0 ) 
 	 { 
 	 	 i f   ( y   <   1 0 0 )   { y   =   2 0 0 0   +   y ; } 
 	 	 t m . y e a r   =   y ; 
 	 } 
 	 i f   ( m   >   0 )   { t m . m o n   =   m ; } 
 	 i f   ( d   >   0 )   { t m . d a y   =   ( i n t ) M a t h F l o o r ( d ) ; } 
 
 	 t m . h o u r   =   ( i n t ) ( M a t h F l o o r ( h )   +   ( 2 4   *   ( d   -   M a t h F l o o r ( d ) ) ) ) ; 
 	 t m . m i n     =   ( i n t ) ( M a t h F l o o r ( i )   +   ( 6 0   *   ( h   -   M a t h F l o o r ( h ) ) ) ) ; 
 	 t m . s e c     =   ( i n t ) ( ( d o u b l e ) s   +   ( 6 0   *   ( i   -   M a t h F l o o r ( i ) ) ) ) ; 
 
 	 r e t u r n   S t r u c t T o T i m e ( t m ) ; 
 }  
  
 b o o l   T r a d e S e l e c t B y I n d e x ( 
 	 i n t   i n d e x , 
 	 s t r i n g   g r o u p _ m o d e         =   " a l l " , 
 	 s t r i n g   g r o u p                   =   " 0 " , 
 	 s t r i n g   m a r k e t _ m o d e       =   " a l l " , 
 	 s t r i n g   m a r k e t                 =   " " , 
 	 s t r i n g   B u y s O r S e l l s       =   " b o t h " 
 )   { 
 	 i f   ( O r d e r S e l e c t ( ( i n t ) i n d e x ,   S E L E C T _ B Y _ P O S ,   M O D E _ T R A D E S )   & &   O r d e r T y p e ( )   <   2 ) 
 	 { 
 	 	 i f   ( F i l t e r O r d e r B y ( 
 	 	 	 g r o u p _ m o d e , 
 	 	 	 g r o u p , 
 	 	 	 m a r k e t _ m o d e , 
 	 	 	 m a r k e t , 
 	 	 	 B u y s O r S e l l s , 
 	 	 	 " b o t h " , 
 	 	 	 0 ) 
 	 	 )   { 
 	 	 	 r e t u r n   t r u e ; 
 	 	 } 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 b o o l   T r a d e S e l e c t B y T i c k e t ( u l o n g   t i c k e t ) 
 { 
 	 i f   ( O r d e r S e l e c t ( ( i n t ) t i c k e t ,   S E L E C T _ B Y _ T I C K E T ,   M O D E _ T R A D E S )   & &   O r d e r T y p e ( )   <   2 ) 
 	 { 
 	 	 r e t u r n   t r u e ; 
 	 } 
 
 	 r e t u r n   f a l s e ; 
 }  
  
 i n t   T r a d e s T o t a l ( ) 
 { 
 	 r e t u r n   O r d e r s T o t a l ( ) ; 
 }  
  
 d o u b l e   V i r t u a l S t o p s D r i v e r ( 
 	 s t r i n g   c o m m a n d   =   " " , 
 	 u l o n g   t i               =   0 , 
 	 d o u b l e   s l             =   0 , 
 	 d o u b l e   t p             =   0 , 
 	 d o u b l e   s l p           =   0 , 
 	 d o u b l e   t p p           =   0 
 ) 
 { 
 	 s t a t i c   b o o l   i n i t i a l i z e d           =   f a l s e ; 
 	 s t a t i c   s t r i n g   n a m e                     =   " " ; 
 	 s t a t i c   s t r i n g   l o o p _ n a m e [ 2 ]     =   { " s l " ,   " t p " } ; 
 	 s t a t i c   c o l o r     l o o p _ c o l o r [ 2 ]   =   { D e e p P i n k ,   D o d g e r B l u e } ; 
 	 s t a t i c   d o u b l e   l o o p _ p r i c e [ 2 ]   =   { 0 ,   0 } ; 
 	 s t a t i c   u l o n g   m e m _ t o _ t i [ ] ;   / /   t i c k e t s 
 	 s t a t i c   i n t   m e m _ t o [ ] ;             / /   t i m e o u t s 
 	 s t a t i c   b o o l   t r a d e _ p a s s   =   f a l s e ; 
 	 i n t   i   =   0 ; 
 
 	 / /   A r e   V i r t u a l   S t o p s   e v e n   e n a b l e d ? 
 	 i f   ( ! U S E _ V I R T U A L _ S T O P S ) 
 	 { 
 	 	 r e t u r n   0 ; 
 	 } 
 	 
 	 i f   ( i n i t i a l i z e d   = =   f a l s e   | |   c o m m a n d   = =   " i n i t i a l i z e " ) 
 	 { 
 	 	 i n i t i a l i z e d   =   t r u e ; 
 	 } 
 
 	 / /   L i s t e n 
 	 i f   ( c o m m a n d   = =   " "   | |   c o m m a n d   = =   " l i s t e n " ) 
 	 { 
 	 	 i n t   t o t a l           =   O b j e c t s T o t a l ( 0 ,   - 1 ,   O B J _ H L I N E ) ; 
 	 	 i n t   l e n g t h         =   0 ; 
 	 	 c o l o r   c l r           =   c l r N O N E ; 
 	 	 i n t   s l t p             =   0 ; 
 	 	 u l o n g   t i c k e t     =   0 ; 
 	 	 d o u b l e   l e v e l     =   0 ; 
 	 	 d o u b l e   a s k b i d   =   0 ; 
 	 	 i n t   p o l a r i t y     =   0 ; 
 	 	 s t r i n g   s y m b o l   =   " " ; 
 
 	 	 f o r   ( i   =   t o t a l   -   1 ;   i   > =   0 ;   i - - ) 
 	 	 { 
 	 	 	 n a m e   =   O b j e c t N a m e ( 0 ,   i ,   - 1 ,   O B J _ H L I N E ) ;   / /   f o r   e x a m p l e :   # 1   s l 
 
 	 	 	 i f   ( S t r i n g S u b s t r ( n a m e ,   0 ,   1 )   ! =   " # " ) 
 	 	 	 { 
 	 	 	 	 c o n t i n u e ; 
 	 	 	 } 
 
 	 	 	 l e n g t h   =   S t r i n g L e n ( n a m e ) ; 
 
 	 	 	 i f   ( l e n g t h   <   5 ) 
 	 	 	 { 
 	 	 	 	 c o n t i n u e ; 
 	 	 	 } 
 
 	 	 	 c l r   =   ( c o l o r ) O b j e c t G e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ) ; 
 
 	 	 	 i f   ( c l r   ! =   l o o p _ c o l o r [ 0 ]   & &   c l r   ! =   l o o p _ c o l o r [ 1 ] ) 
 	 	 	 { 
 	 	 	 	 c o n t i n u e ; 
 	 	 	 } 
 
 	 	 	 s t r i n g   l a s t _ s y m b o l s   =   S t r i n g S u b s t r ( n a m e ,   l e n g t h - 2 ,   2 ) ; 
 
 	 	 	 i f   ( l a s t _ s y m b o l s   = =   " s l " ) 
 	 	 	 { 
 	 	 	 	 s l t p   =   - 1 ; 
 	 	 	 } 
 	 	 	 e l s e   i f   ( l a s t _ s y m b o l s   = =   " t p " ) 
 	 	 	 { 
 	 	 	 	 s l t p   =   1 ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 c o n t i n u e ; 	 
 	 	 	 } 
 
 	 	 	 u l o n g   t i c k e t 0   =   S t r i n g T o I n t e g e r ( S t r i n g S u b s t r ( n a m e ,   1 ,   l e n g t h   -   4 ) ) ; 
 
 	 	 	 / /   p r e v e n t   l o a d i n g   t h e   s a m e   t i c k e t   n u m b e r   t w i c e   i n   a   r o w 
 	 	 	 i f   ( t i c k e t 0   ! =   t i c k e t ) 
 	 	 	 { 
 	 	 	 	 t i c k e t   =   t i c k e t 0 ; 
 
 	 	 	 	 i f   ( T r a d e S e l e c t B y T i c k e t ( t i c k e t ) ) 
 	 	 	 	 { 
 	 	 	 	 	 s y m b o l           =   O r d e r S y m b o l ( ) ; 
 	 	 	 	 	 p o l a r i t y       =   ( O r d e r T y p e ( )   = =   0 )   ?   1   :   - 1 ; 
 	 	 	 	 	 a s k b i d       =   ( O r d e r T y p e ( )   = =   0 )   ?   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ B I D )   :   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ A S K ) ; 
 	 	 	 	 	 
 	 	 	 	 	 t r a d e _ p a s s   =   t r u e ; 
 	 	 	 	 } 
 	 	 	 	 e l s e 
 	 	 	 	 { 
 	 	 	 	 	 t r a d e _ p a s s   =   f a l s e ; 
 	 	 	 	 } 
 	 	 	 } 
 
 	 	 	 i f   ( t r a d e _ p a s s ) 
 	 	 	 { 
 	 	 	 	 l e v e l         =   O b j e c t G e t D o u b l e ( 0 ,   n a m e ,   O B J P R O P _ P R I C E ,   0 ) ; 
 
 	 	 	 	 i f   ( l e v e l   >   0 ) 
 	 	 	 	 { 
 	 	 	 	 	 / /   p o l a r i z e   l e v e l s 
 	 	 	 	 	 d o u b l e   l e v e l _ p     =   p o l a r i t y   *   l e v e l ; 
 	 	 	 	 	 d o u b l e   a s k b i d _ p   =   p o l a r i t y   *   a s k b i d ; 
 
 	 	 	 	 	 i f   ( 
 	 	 	 	 	 	       ( s l t p   = =   - 1   & &   ( l e v e l _ p   -   a s k b i d _ p )   > =   0 )   / /   s l 
 	 	 	 	 	 	 | |   ( s l t p   = =   1   & &   ( a s k b i d _ p   -   l e v e l _ p )   > =   0 )     / /   t p 
 	 	 	 	 	 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 / / - -   V i r t u a l   S t o p s   S L   T i m e o u t 
 	 	 	 	 	 	 i f   ( 
 	 	 	 	 	 	 	       ( V I R T U A L _ S T O P S _ T I M E O U T   >   0 ) 
 	 	 	 	 	 	 	 & &   ( s l t p   = =   - 1   & &   ( l e v e l _ p   -   a s k b i d _ p )   > =   0 )   / /   s l 
 	 	 	 	 	 	 ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 / /   s t a r t   t i m e o u t ? 
 	 	 	 	 	 	 	 i n t   i n d e x   =   A r r a y S e a r c h ( m e m _ t o _ t i ,   t i c k e t ) ; 
 
 	 	 	 	 	 	 	 i f   ( i n d e x   <   0 ) 
 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 i n t   s i z e   =   A r r a y S i z e ( m e m _ t o _ t i ) ; 
 	 	 	 	 	 	 	 	 A r r a y R e s i z e ( m e m _ t o _ t i ,   s i z e + 1 ) ; 
 	 	 	 	 	 	 	 	 A r r a y R e s i z e ( m e m _ t o ,   s i z e + 1 ) ; 
 	 	 	 	 	 	 	 	 m e m _ t o _ t i [ s i z e ]   =   t i c k e t ; 
 	 	 	 	 	 	 	 	 m e m _ t o [ s i z e ]         =   ( i n t ) T i m e L o c a l ( ) ; 
 
 	 	 	 	 	 	 	 	 P r i n t ( 
 	 	 	 	 	 	 	 	 	 " # " , 
 	 	 	 	 	 	 	 	 	 t i c k e t , 
 	 	 	 	 	 	 	 	 	 "   t i m e o u t   o f   " , 
 	 	 	 	 	 	 	 	 	 V I R T U A L _ S T O P S _ T I M E O U T , 
 	 	 	 	 	 	 	 	 	 "   s e c o n d s   s t a r t e d " 
 	 	 	 	 	 	 	 	 ) ; 
 
 	 	 	 	 	 	 	 	 r e t u r n   0 ; 
 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 	 e l s e 
 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 i f   ( T i m e L o c a l ( )   -   m e m _ t o [ i n d e x ]   < =   V I R T U A L _ S T O P S _ T I M E O U T ) 
 	 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 	 r e t u r n   0 ; 
 	 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 } 
 
 	 	 	 	 	 	 i f   ( C l o s e T r a d e ( t i c k e t ) ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 / /   c h e c k   t h i s   b e f o r e   d e l e t i n g   t h e   l i n e s 
 	 	 	 	 	 	 	 / / O n T r a d e L i s t e n e r ( ) ; 
 
 	 	 	 	 	 	 	 / /   d e l e t e   o b j e c t s 
 	 	 	 	 	 	 	 O b j e c t D e l e t e ( 0 ,   " # "   +   ( s t r i n g ) t i c k e t   +   "   s l " ) ; 
 	 	 	 	 	 	 	 O b j e c t D e l e t e ( 0 ,   " # "   +   ( s t r i n g ) t i c k e t   +   "   t p " ) ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 	 e l s e 
 	 	 	 	 	 { 
 	 	 	 	 	 	 i f   ( V I R T U A L _ S T O P S _ T I M E O U T   >   0 ) 
 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 i   =   A r r a y S e a r c h ( m e m _ t o _ t i ,   t i c k e t ) ; 
 
 	 	 	 	 	 	 	 i f   ( i   > =   0 ) 
 	 	 	 	 	 	 	 { 
 	 	 	 	 	 	 	 	 A r r a y S t r i p K e y ( m e m _ t o _ t i ,   i ) ; 
 	 	 	 	 	 	 	 	 A r r a y S t r i p K e y ( m e m _ t o ,   i ) ; 
 	 	 	 	 	 	 	 } 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 e l s e   i f   ( 
 	 	 	 	 	 ! P e n d i n g O r d e r S e l e c t B y T i c k e t ( t i c k e t ) 
 	 	 	 	 | |   O r d e r C l o s e T i m e ( )   >   0   / /   i n   c a s e   t h e   o r d e r   h a s   b e e n   c l o s e d 
 	 	 	 ) 
 	 	 	 { 
 	 	 	 	 O b j e c t D e l e t e ( 0 ,   n a m e ) ; 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 P e n d i n g O r d e r S e l e c t B y T i c k e t ( t i c k e t ) ; 
 	 	 	 } 
 	 	 } 
 	 } 
 	 / /   G e t   S L   o r   T P 
 	 e l s e   i f   ( 
 	 	 t i   >   0 
 	 	 & &   ( 
 	 	 	       c o m m a n d   = =   " g e t   s l " 
 	 	 	 | |   c o m m a n d   = =   " g e t   t p " 
 	 	 ) 
 	 ) 
 	 { 
 	 	 d o u b l e   v a l u e   =   0 ; 
 
 	 	 n a m e   =   " # "   +   I n t e g e r T o S t r i n g ( t i )   +   "   "   +   S t r i n g S u b s t r ( c o m m a n d ,   4 ,   2 ) ; 
 
 	 	 i f   ( O b j e c t F i n d ( 0 ,   n a m e )   >   - 1 ) 
 	 	 { 
 	 	 	 v a l u e   =   O b j e c t G e t D o u b l e ( 0 ,   n a m e ,   O B J P R O P _ P R I C E ,   0 ) ; 
 	 	 } 
 
 	 	 r e t u r n   v a l u e ; 
 	 } 
 	 / /   S e t   S L   a n d   T P 
 	 e l s e   i f   ( 
 	 	 t i   >   0 
 	 	 & &   ( 
 	 	 	       c o m m a n d   = =   " s e t " 
 	 	 	 | |   c o m m a n d   = =   " m o d i f y " 
 	 	 	 | |   c o m m a n d   = =   " c l e a r " 
 	 	 	 | |   c o m m a n d   = =   " p a r t i a l " 
 	 	 ) 
 	 ) 
 	 { 
 	 	 l o o p _ p r i c e [ 0 ]   =   s l ; 
 	 	 l o o p _ p r i c e [ 1 ]   =   t p ; 
 
 	 	 f o r   ( i   =   0 ;   i   <   2 ;   i + + ) 
 	 	 { 
 	 	 	 n a m e   =   " # "   +   I n t e g e r T o S t r i n g ( t i )   +   "   "   +   l o o p _ n a m e [ i ] ; 
 	 	 	 
 	 	 	 i f   ( l o o p _ p r i c e [ i ]   >   0 ) 
 	 	 	 { 
 	 	 	 	 / /   1 )   c r e a t e   a   n e w   l i n e 
 	 	 	 	 i f   ( O b j e c t F i n d ( 0 ,   n a m e )   = =   - 1 ) 
 	 	 	 	 { 
 	 	 	 	 	 	   O b j e c t C r e a t e ( 0 ,   n a m e ,   O B J _ H L I N E ,   0 ,   0 ,   l o o p _ p r i c e [ i ] ) ; 
 	 	 	 	 	 O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ W I D T H ,   1 ) ; 
 	 	 	 	 	 O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ C O L O R ,   l o o p _ c o l o r [ i ] ) ; 
 	 	 	 	 	 O b j e c t S e t I n t e g e r ( 0 ,   n a m e ,   O B J P R O P _ S T Y L E ,   S T Y L E _ D O T ) ; 
 	 	 	 	 	 O b j e c t S e t S t r i n g ( 0 ,   n a m e ,   O B J P R O P _ T E X T ,   n a m e   +   "   ( v i r t u a l ) " ) ; 
 	 	 	 	 } 
 	 	 	 	 / /   2 )   m o d i f y   e x i s t i n g   l i n e 
 	 	 	 	 e l s e 
 	 	 	 	 { 
 	 	 	 	 	 O b j e c t S e t D o u b l e ( 0 ,   n a m e ,   O B J P R O P _ P R I C E ,   0 ,   l o o p _ p r i c e [ i ] ) ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 e l s e 
 	 	 	 { 
 	 	 	 	 / /   3 )   d e l e t e   e x i s t i n g   l i n e 
 	 	 	 	 O b j e c t D e l e t e ( 0 ,   n a m e ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 / /   p r i n t   m e s s a g e 
 	 	 i f   ( c o m m a n d   = =   " s e t "   | |   c o m m a n d   = =   " m o d i f y " ) 
 	 	 { 
 	 	 	 P r i n t ( 
 	 	 	 	 c o m m a n d , 
 	 	 	 	 "   # " , 
 	 	 	 	 I n t e g e r T o S t r i n g ( t i ) , 
 	 	 	 	 " :   v i r t u a l   s l   " , 
 	 	 	 	 D o u b l e T o S t r ( s l ,   ( i n t ) S y m b o l I n f o I n t e g e r ( S y m b o l ( ) , S Y M B O L _ D I G I T S ) ) , 
 	 	 	 	 "   t p   " , 
 	 	 	 	 D o u b l e T o S t r ( t p , ( i n t ) S y m b o l I n f o I n t e g e r ( S y m b o l ( ) , S Y M B O L _ D I G I T S ) ) 
 	 	 	 ) ; 
 	 	 } 
 
 	 	 r e t u r n   1 ; 
 	 } 
 
 	 r e t u r n   1 ; 
 }  
  
 v o i d   W a i t T r a d e C o n t e x t I f B u s y ( )  
 {  
 	 i f ( I s T r a d e C o n t e x t B u s y ( ) )   {  
             w h i l e ( t r u e )  
             {  
                   S l e e p ( 1 ) ;  
                   i f ( ! I s T r a d e C o n t e x t B u s y ( ) )   {  
                         R e f r e s h R a t e s ( ) ;  
                         b r e a k ;  
                   }  
             }  
       }  
       r e t u r n ;  
 }  
  
 i n t   W i n d o w F i n d V i s i b l e ( l o n g   c h a r t _ i d ,   s t r i n g   t e r m )  
 {  
       / / - -   t h e   s e a r c h   t e r m   c a n   b e   c h a r t   n a m e ,   s u c h   a s   F o r c e ( 1 3 ) ,   o r   s u b w i n d o w   i n d e x  
       i f   ( t e r m   = =   " "   | |   t e r m   = =   " 0 " )   { r e t u r n   0 ; }  
        
       i n t   s u b w i n d o w   =   ( i n t ) S t r i n g T o I n t e g e r ( t e r m ) ;  
      
       i f   ( s u b w i n d o w   = =   0   & &   S t r i n g L e n ( t e r m )   >   1 )  
       {  
             s u b w i n d o w   =   C h a r t W i n d o w F i n d ( c h a r t _ i d ,   t e r m ) ;  
       }  
        
       i f   ( s u b w i n d o w   >   0   & &   ! C h a r t G e t I n t e g e r ( c h a r t _ i d ,   C H A R T _ W I N D O W _ I S _ V I S I B L E ,   s u b w i n d o w ) )  
       {  
             r e t u r n   - 1 ;      
       }  
        
       r e t u r n   s u b w i n d o w ;  
 }  
  
 d o u b l e   a t t r S t o p L o s s ( ) 
 { 
 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 { 
 	 	 r e t u r n   V i r t u a l S t o p s D r i v e r ( " g e t   s l " ,   O r d e r T i c k e t ( ) ) ; 
 	 } 
 
 	 r e t u r n   O r d e r S t o p L o s s ( ) ; 
 }  
  
 d o u b l e   a t t r T a k e P r o f i t ( ) 
 { 
 	 i f   ( U S E _ V I R T U A L _ S T O P S ) 
 	 { 
 	 	 r e t u r n   V i r t u a l S t o p s D r i v e r ( " g e t   t p " ,   O r d e r T i c k e t ( ) ) ; 
 	 } 
 
       r e t u r n   O r d e r T a k e P r o f i t ( ) ; 
 }  
  
 l o n g   a t t r T i c k e t P a r e n t ( l o n g   t i c k e t ) 
 { 
 	 i n t   p o s ,   t o t a l ; 
 	 l o n g   r e t v a l   =   0 ; 
 	 s t a t i c   l o n g   p a r e n t s _ i d x [ ] ; 
 	 s t a t i c   l o n g   p a r e n t s [ ] ; 
 
 	 / / - -   i f   p a r e n t   t i c k e t   i s   k n o w n ,   r e t u r n   i t   - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 i n t   s i z e   =   A r r a y S i z e ( p a r e n t s _ i d x ) ; 
 	 i n t   i d x     =   - 1 ; 
 
 	 i f   ( s i z e   >   0 ) 
 	 { 
 	 	 f o r   ( i n t   i = s i z e - 1 ;   i > = 0 ;   i - - ) 
 	 	 { 
 	 	 	 i f   ( p a r e n t s _ i d x [ i ]   = =   t i c k e t ) 
 	 	 	 { 
 	 	 	 	 i d x   =   i ; 
 	 	 	 	 b r e a k ; 
 	 	 	 }     
 	 	 } 
 	 } 
 
 	 i f   ( i d x   > -   1 ) 
 	 { 
 	 	 r e t v a l   =   p a r e n t s [ i d x ] ; 
 	 } 
 	 e l s e 
 	 { 
 	 	 i f   ( ! O r d e r S e l e c t ( ( i n t ) t i c k e t , S E L E C T _ B Y _ T I C K E T ) ) 
 	 	 { 
 	 	 	 r e t v a l   =   t i c k e t ; 
 	 	 } 
 
 	 	 / / - -   c h e c k   i f   t r a d e   i s   a d d e d   t o   v o l u m e   - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 	 	 i f   ( r e t v a l   = =   0 ) 
 	 	 { 
 	 	 	 s t r i n g   c o m m e n t   =   O r d e r C o m m e n t ( ) ; 
 	 	 	 i n t   p _ p o s             =   S t r i n g F i n d ( c o m m e n t ,   " [ p = " ) ; 
 
 	 	 	 i f   ( p _ p o s   > =   0 ) 
 	 	 	 { 
 	 	 	 	 s t r i n g   p _ t a g   =   S t r i n g S u b s t r ( c o m m e n t , p _ p o s ) ; 
 	 	 	 	 p _ t a g                 =   S t r i n g S u b s t r ( p _ t a g , 0 , S t r i n g F i n d ( p _ t a g , " ] " ) + 1 ) ; 
 	 	 	 	 r e t v a l               =   ( i n t ) S t r i n g T o I n t e g e r ( S t r i n g S u b s t r ( p _ t a g , 3 , - 1 ) ) ; 
 	 	 	 } 
 	 	 } 
 
 	 	 d o u b l e   O P       =   O r d e r O p e n P r i c e ( ) ; 
 	 	 d a t e t i m e   O T   =   O r d e r O p e n T i m e ( ) ; 
 	 	 s t r i n g   S         =   O r d e r S y m b o l ( ) ; 
 	 	 i n t   M               =   O r d e r M a g i c N u m b e r ( ) ; 
 	 	 i n t   T               =   O r d e r T y p e ( ) ;   
 	 	 d o u b l e   L         =   O r d e r L o t s ( ) ; 
 	 	 i n t   D               =   ( i n t ) M a r k e t I n f o ( S , M O D E _ D I G I T S ) ; 
 
 	 	 / / - -   C h e c k   " f r o m   # N u m b e r "   c o m m e n t 
 	 	 i f   ( r e t v a l   = =   0 ) 
 	 	 { 
 	 	 	 t o t a l   =   O r d e r s T o t a l ( ) ; 
 	 	 	 l o n g   t i c k e t T m p       =   t i c k e t ; 
 
 	 	 	 / /   N o w   s t a r t   r e c u r s i v e   s e a r c h   f r o m   t r a d e   t o   t r a d e   t o   f i n d   t h e   p a r e n t   o n e 
 	 	 	 w h i l e   ( t r u e ) 
 	 	 	 { 
 	 	 	 	 i f   ( ! O r d e r S e l e c t ( ( i n t ) t i c k e t T m p ,   S E L E C T _ B Y _ T I C K E T ) ) 
 	 	 	 	 { 
 	 	 	 	 	 r e t v a l   =   t i c k e t ; 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 	 	 	 
 	 	 	 	 s t r i n g   c o m m e n t   =   O r d e r C o m m e n t ( ) ; 
 
 	 	 	 	 i f   ( S t r i n g S u b s t r ( c o m m e n t ,   0 ,   6 )   = =   " f r o m   # " ) 
 	 	 	 	 { 
 	 	 	 	 	 l o n g   t i c k e t C u r r e n t   =   ( l o n g ) S t r i n g T o I n t e g e r ( S t r i n g S u b s t r ( c o m m e n t ,   6 ) ) ; 
 	 	 	 	 	 
 	 	 	 	 	 i f   ( t i c k e t T m p   = =   t i c k e t C u r r e n t ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 / /   e v e n t u a l l y   t h e   m o s t   p a r e n t   t r a d e   h a s   i t s   o w n   t i c k e t   n u m b e r   i n   " f r o m   # N u m b e r " ,   s o   s t o p   h e r e 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 } 
 	 	 	 	 	 e l s e 
 	 	 	 	 	 { 
 	 	 	 	 	 	 / /   i f   t h e   t i c k e t   n u m b e r   i n   " f r o m   # N u m b e r "   i s   d i f f e r e n t ,   g o   t o   l o a d   t h a t   t i c k e t   n u m b e r 
 	 	 	 	 	 	 t i c k e t T m p   =   t i c k e t C u r r e n t ; 
 	 	 	 	 	 	 c o n t i n u e ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 	 e l s e 
 	 	 	 	 { 
 	 	 	 	 	 r e t v a l   =   t i c k e t T m p ; 
 	 	 	 	 	 b r e a k ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 
 	 	 / / - -   c h e c k   i f   t r a d e   i s   p a r t i a l l y   c l o s e d   ( i n   t r a d e s )   - - - - - - - - - - - - - - - 
 	 	 i f   ( r e t v a l   = =   0 ) 
 	 	 { 
 	 	 	 t o t a l   =   O r d e r s T o t a l ( ) ; 
 
 	 	 	 f o r   ( p o s = t o t a l - 1 ;   p o s > = 0 ;   p o s - - ) 
 	 	 	 { 
 	 	 	 	 i f   ( O r d e r S e l e c t ( p o s , S E L E C T _ B Y _ P O S , M O D E _ T R A D E S ) ) 
 	 	 	 	 { 
 	 	 	 	 	 i f   ( O r d e r O p e n T i m e ( )   <   O T ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 } 
 
 	 	 	 	 	 i f   ( 
 	 	 	 	 	 	 O r d e r T i c k e t ( )   <   t i c k e t 
 	 	 	 	 	 	 & &   ( O r d e r S y m b o l ( )   = =   S ) 
 	 	 	 	 	 	 & &   ( O r d e r M a g i c N u m b e r ( )   = =   M ) 
 	 	 	 	 	 	 & &   ( O r d e r T y p e ( )   = =   T ) 
 	 	 	 	 	 	 & &   ( N o r m a l i z e D o u b l e ( O r d e r O p e n P r i c e ( ) , D )   = =   N o r m a l i z e D o u b l e ( O P , D ) ) 
 	 	 	 	 	 	 & &   ( O r d e r O p e n T i m e ( )   = =   O T ) 
 	 	 	 	 	 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 
 	 	 	 	 	 	 r e t v a l   =   O r d e r T i c k e t ( ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 
 	 	 / / - -   s t i l l   n o t h i n g   f o u n d   -   s e a r c h   i n   h i s t o r y   t r a d e s   n o w   - - - - - - - - - - - 
 	 	 i f   ( r e t v a l   = =   0 ) 
 	 	 { 
 	 	 	 t o t a l   =   O r d e r s H i s t o r y T o t a l ( ) ; 
 
 	 	 	 f o r   ( p o s = t o t a l - 1 ;   p o s > = 0 ;   p o s - - ) 
 	 	 	 { 
 	 	 	 	 i f   ( O r d e r S e l e c t ( p o s , S E L E C T _ B Y _ P O S , M O D E _ H I S T O R Y ) ) 
 	 	 	 	 { 
 	 	 	 	 	 i f   ( O r d e r O p e n T i m e ( )   <   O T ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 b r e a k ; 
 	 	 	 	 	 } 
 
 	 	 	 	 	 i f   ( 
 	 	 	 	 	 	 O r d e r T i c k e t ( )   <   t i c k e t 
 	 	 	 	 	 	 & &   ( O r d e r S y m b o l ( )   = =   S ) 
 	 	 	 	 	 	 & &   ( O r d e r M a g i c N u m b e r ( )   = =   M ) 
 	 	 	 	 	 	 & &   ( O r d e r T y p e ( )   = =   T ) 
 	 	 	 	 	 	 & &   ( N o r m a l i z e D o u b l e ( O r d e r O p e n P r i c e ( ) , D )   = =   N o r m a l i z e D o u b l e ( O P , D ) ) 
 	 	 	 	 	 	 & &   ( O r d e r O p e n T i m e ( )   = =   O T ) 
 	 	 	 	 	 ) 
 	 	 	 	 	 { 
 	 	 	 	 	 	 r e t v a l   =   O r d e r T i c k e t ( ) ; 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 
 	 	 i f   ( r e t v a l   >   0 ) 
 	 	 { 
 	 	 	 s i z e = A r r a y S i z e ( p a r e n t s _ i d x ) ; 
 	 	 	 A r r a y R e s i z e ( p a r e n t s _ i d x , s i z e + 1 ) ; 
 	 	 	 A r r a y R e s i z e ( p a r e n t s , s i z e + 1 ) ; 
 	 	 	 p a r e n t s _ i d x [ s i z e ]   =   t i c k e t ; 
 	 	 	 p a r e n t s [ s i z e ]           =   r e t v a l ; 
 	 	 } 
 	 } 
 
 	 i f   ( ! O r d e r S e l e c t ( ( i n t ) t i c k e t , S E L E C T _ B Y _ T I C K E T ) ) 
 	 { 
 	 	 r e t v a l   =   t i c k e t ; 
 	 } 
 
 	 i f   ( r e t v a l   < =   0 ) 
 	 { 
 	 	 r e t v a l   =   t i c k e t ; 
 	 } 
 
 	 r e t u r n   r e t v a l ; 
 }  
  
 s t r i n g   e _ R e a s o n ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e R e a s o n ( ) ; }  
  
 s t r i n g   e _ R e a s o n D e t a i l ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e D e t a i l ( ) ; }  
  
 d o u b l e   e _ a t t r C l o s e P r i c e ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e P r i c e C l o s e ( ) ; }  
  
 d a t e t i m e   e _ a t t r C l o s e T i m e ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e T i m e C l o s e ( ) ; }  
  
 s t r i n g   e _ a t t r C o m m e n t ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e C o m m e n t ( ) ; }  
  
 d a t e t i m e   e _ a t t r E x p i r a t i o n ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e T i m e E x p i r a t i o n ( ) ; }  
  
 d o u b l e   e _ a t t r L o t s ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e V o l u m e ( ) ; }  
  
 i n t   e _ a t t r M a g i c N u m b e r ( )   { r e t u r n   ( i n t ) o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e M a g i c ( ) ; }  
  
 d o u b l e   e _ a t t r O p e n P r i c e ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e P r i c e O p e n ( ) ; }  
  
 d a t e t i m e   e _ a t t r O p e n T i m e ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e T i m e O p e n ( ) ; }  
  
 d o u b l e   e _ a t t r P r o f i t ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e P r o f i t ( ) ; }  
  
 d o u b l e   e _ a t t r S t o p L o s s ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e S t o p L o s s ( ) ; }  
  
 d o u b l e   e _ a t t r S w a p ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e S w a p ( ) ; }  
  
 s t r i n g   e _ a t t r S y m b o l ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e S y m b o l ( ) ; }  
  
 d o u b l e   e _ a t t r T a k e P r o f i t ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e T a k e P r o f i t ( ) ; }  
  
 i n t   e _ a t t r T i c k e t ( )   { r e t u r n   ( i n t ) o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e T i c k e t ( ) ; }  
  
 i n t   e _ a t t r T y p e ( )   { r e t u r n   o n T r a d e E v e n t D e t e c t o r . E v e n t V a l u e T y p e ( ) ; }  
  
 t e m p l a t e < t y p e n a m e   D T 1 ,   t y p e n a m e   D T 2 > 
 d o u b l e   f o r m u l a ( s t r i n g   s i g n ,   D T 1   v 1 ,   D T 2   v 2 ) 
 { 
 	           i f   ( s i g n   = =   " + " )   r e t u r n ( v 1   +   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " - " )   r e t u r n ( v 1   -   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " * " )   r e t u r n ( v 1   *   v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " / " )   r e t u r n ( v 1   /   v 2 ) ; 
 
 	 r e t u r n   f a l s e ; 
 } 
 
 s t r i n g   f o r m u l a ( s t r i n g   s i g n ,   s t r i n g   v 1 ,   s t r i n g   v 2 ) 
 { 
 	 i f   ( s i g n   = =   " + " )   r e t u r n ( v 1   +   v 2 ) ; 
 	 e l s e   { 
 	 	 d o u b l e   _ v 1   =   S t r i n g T o D o u b l e ( v 1 ) ; 
 	 	 d o u b l e   _ v 2   =   S t r i n g T o D o u b l e ( v 2 ) ; 
 	 	 
 	 	           i f   ( s i g n   = =   " - " )   r e t u r n   D o u b l e T o S t r i n g ( _ v 1   -   _ v 2 ) ; 
 	 	 e l s e   i f   ( s i g n   = =   " * " )   r e t u r n   D o u b l e T o S t r i n g ( _ v 1   *   _ v 2 ) ; 
 	 	 e l s e   i f   ( s i g n   = =   " / " )   r e t u r n   D o u b l e T o S t r i n g ( _ v 1   /   _ v 2 ) ; 
 	 } 
 
 	 r e t u r n   v 1   +   v 2 ; 
 } 
 
 d o u b l e   f o r m u l a ( s t r i n g   s i g n ,   s t r i n g   v 1 ,   d o u b l e   v 2 ) 
 { 
 	           i f   ( s i g n   = =   " + " )   r e t u r n   S t r i n g T o D o u b l e ( v 1 )   +   v 2 ; 
 	 e l s e   i f   ( s i g n   = =   " - " )   r e t u r n   S t r i n g T o D o u b l e ( v 1 )   -   v 2 ; 
 	 e l s e   i f   ( s i g n   = =   " * " )   r e t u r n   S t r i n g T o D o u b l e ( v 1 )   *   v 2 ; 
 	 e l s e   i f   ( s i g n   = =   " / " )   r e t u r n   S t r i n g T o D o u b l e ( v 1 )   /   v 2 ; 
 
 	 r e t u r n   S t r i n g T o D o u b l e ( v 1 )   +   v 2 ; 
 } 
 
 d o u b l e   f o r m u l a ( s t r i n g   s i g n ,   d o u b l e   v 1 ,   s t r i n g   v 2 ) 
 { 
 	 i f   ( s i g n   = =   " + " )   r e t u r n   ( v 1   +   S t r i n g T o D o u b l e ( v 2 ) ) ; 
 	 e l s e   i f   ( s i g n   = =   " - " )   r e t u r n   v 1   -   S t r i n g T o D o u b l e ( v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " * " )   r e t u r n   v 1   *   S t r i n g T o D o u b l e ( v 2 ) ; 
 	 e l s e   i f   ( s i g n   = =   " / " )   r e t u r n   v 1   /   S t r i n g T o D o u b l e ( v 2 ) ; 
 
 	 r e t u r n   v 1   +   S t r i n g T o D o u b l e ( v 2 ) ; 
 }  
  
 i n t   i C a n d l e I D ( s t r i n g   S Y M B O L ,   E N U M _ T I M E F R A M E S   T I M E F R A M E ,   d a t e t i m e   t i m e _ s t a m p ) 
 { 
 	 b o o l   T i m e S t a m p P r e v D a y S h i f t   =   t r u e ; 
 	 i n t   C a n d l e I D                               =   0 ; 
 
 	 / /   g e t   t h e   t i m e   r e s o l u t i o n   o f   t h e   d e s i r e d   p e r i o d ,   i n   m i n u t e s 
 	 i n t   m i n s _ t f     =   T I M E F R A M E ; 
 	 i n t   m i n s _ t f 0   =   0 ; 
 
 	 i f   ( T I M E F R A M E   = =   P E R I O D _ C U R R E N T ) 
 	 { 
 	 	 m i n s _ t f   =   ( i n t ) P e r i o d S e c o n d s ( P E R I O D _ C U R R E N T )   /   6 0 ; 
 	 } 
 
 	 / /   g e t   t h e   d i f f e r e n c e   b e t w e e n   n o w   a n d   t h e   t i m e   w e   w a n t ,   i n   m i n u t e s 
 	 i n t   d a y s _ a d j u s t   =   0 ; 
 
 	 i f   ( T i m e S t a m p P r e v D a y S h i f t ) 
 	 { 
 	 	 / /   a u t o m a t i c a l l y   s h i f t   t o   t h e   p r e v i o u s   d a y 
 	 	 i f   ( t i m e _ s t a m p   >   T i m e C u r r e n t ( ) ) 
 	 	 { 
 	 	 	 t i m e _ s t a m p   =   t i m e _ s t a m p   -   8 6 4 0 0 ; 
 	 	 } 
 
 	 	 / /   a l s o   s h i f t   w e e k d a y s 
 	 	 w h i l e   ( t r u e ) 
 	 	 { 
 	 	 	 i n t   d o w   =   T i m e D a y O f W e e k ( t i m e _ s t a m p ) ; 
 
 	 	 	 i f   ( d o w   >   0   & &   d o w   <   6 )   { b r e a k ; } 
 
 	 	 	 t i m e _ s t a m p   =   t i m e _ s t a m p   -   8 6 4 0 0 ; 
 	 	 	 d a y s _ a d j u s t + + ; 
 	 	 } 
 	 } 
 
 	 i n t   m i n s _ d i f f   =   ( i n t ) ( T i m e C u r r e n t ( )   -   t i m e _ s t a m p ) ; 
 	 m i n s _ d i f f   =   m i n s _ d i f f   -   d a y s _ a d j u s t * 8 6 4 0 0 ; 
 	 m i n s _ d i f f   =   m i n s _ d i f f   /   6 0 ; 
 
 	 / /   t h e   d i f f e r e n c e   i s   n e g a t i v e   = >   q u i t   h e r e 
 	 i f   ( m i n s _ d i f f   <   0 ) 
 	 { 
 	 	 r e t u r n   ( i n t ) E M P T Y _ V A L U E ; 
 	 } 
 
 	 / /   n o w   c a l c u l a t e   t h e   c a n d l e   I D ,   i t   i s   r e l a t i v e   t o   t h e   c u r r e n t   t i m e 
 	 i f   ( m i n s _ d i f f   >   0 ) 
 	 { 
 	 	 C a n d l e I D   =   ( i n t ) M a t h C e i l ( ( d o u b l e ) m i n s _ d i f f / ( d o u b l e ) m i n s _ t f ) ; 
 	 } 
 
 	 / /   n o w ,   a f t e r   a l l   t h e   s h i f t i n g   a n d   i n   c a s e   o f   m i s s i n g   c a n d l e s ,   t h e   c a l c u l a t e d   c a n d l e   i d   c a n   b e   f e w   c a n d l e s   e a r l y 
 	 / /   s o   w e   w i l l   s e a r c h   f o r   t h e   r i g h t   c a n d l e 
 	 w h i l e ( t r u e ) 
 	 { 
 	 	 i f   ( i T i m e ( S Y M B O L ,   T I M E F R A M E ,   C a n d l e I D )   > =   t i m e _ s t a m p )   { b r e a k ; } 
 
 	 	 C a n d l e I D - - ; 
 
 	 	 i f   ( C a n d l e I D   < =   0 )   { C a n d l e I D   =   0 ;   b r e a k ; } 
 	 } 
 
 	 r e t u r n   C a n d l e I D ; 
 }  
  
 d o u b l e   t o D i g i t s ( d o u b l e   p i p s ,   s t r i n g   s y m b o l ) 
 { 
 	 i f   ( s y m b o l   = =   " " )   s y m b o l   =   S y m b o l ( ) ; 
 
 	 i n t   d i g i t s       =   ( i n t ) S y m b o l I n f o I n t e g e r ( s y m b o l ,   S Y M B O L _ D I G I T S ) ; 
 	 d o u b l e   p o i n t   =   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ; 
 
 	 r e t u r n   N o r m a l i z e D o u b l e ( p i p s   *   P i p V a l u e ( s y m b o l )   *   p o i n t ,   d i g i t s ) ; 
 }  
  
 d o u b l e   t o P i p s ( d o u b l e   d i g i t s ,   s t r i n g   s y m b o l ) 
 { 
 	 i f   ( s y m b o l   = =   " " )   s y m b o l   =   S y m b o l ( ) ; 
 
       r e t u r n   d i g i t s   /   ( P i p V a l u e ( s y m b o l )   *   S y m b o l I n f o D o u b l e ( s y m b o l ,   S Y M B O L _ P O I N T ) ) ; 
 }  
  
  
  
  
  
  
 c l a s s   F x d W a i t i n g  
 {  
 	 p r i v a t e :  
 	 	 i n t   b e g i n n i n g _ i d ;  
 	 	 u s h o r t   b a n k     [ ] [ 2 ] [ 2 0 ] ;   / /   2   b a n k s ,   2 0   p o s s i b l e   p a r a l l e l   w a i t i n g   b l o c k s   p e r   c h a i n   o f   b l o c k s  
 	 	 u s h o r t   s t a t e   [ ] [ 2 ] ;           / /   s e c o n d   d i m e n t i o n   v a l u e s :   0   -   c o u n t   o f   t h e   b l o c k s   p u t   o n   h o l d ,   1   -   c u r r e n t   b a n k   i d  
  
 	 p u b l i c :  
 	 	 v o i d   I n i t i a l i z e ( i n t   c o u n t )  
 	 	 {  
 	 	 	 A r r a y R e s i z e ( b a n k ,   c o u n t ) ;  
 	 	 	 A r r a y R e s i z e ( s t a t e ,   c o u n t ) ;  
 	 	 }  
  
 	 	 b o o l   R u n ( i n t   i d   =   0 )  
 	 	 {  
 	 	 	 b e g i n n i n g _ i d   =   i d ;  
  
 	 	 	 i n t   r a n g e   =   A r r a y R a n g e ( s t a t e ,   0 ) ;  
 	 	 	 i f   ( r a n g e   <   i d + 1 )   {  
 	 	 	 	 A r r a y R e s i z e ( b a n k ,   i d + 1 ) ;  
 	 	 	 	 A r r a y R e s i z e ( s t a t e ,   i d + 1 ) ;  
  
 	 	 	 	 / /   s e t   v a l u e s   t o   0 ,   o t h e r w i s e   t h e y   h a v e   r a n d o m   v a l u e s  
 	 	 	 	 f o r   ( i n t   i i   =   r a n g e ;   i i   <   i d + 1 ;   i i + + )  
 	 	 	 	 {  
 	 	 	 	       s t a t e [ i i ] [ 0 ]   =   0 ;  
 	 	 	 	       s t a t e [ i i ] [ 1 ]   =   0 ;  
 	 	 	 	 }  
 	 	 	 }  
  
 	 	 	 / /   a r e   t h e r e   b l o c k s   p u t   o n   h o l d ?  
 	 	 	 i n t   c o u n t   =   s t a t e [ i d ] [ 0 ] ;  
 	 	 	 i n t   b a n k _ i d   =   s t a t e [ i d ] [ 1 ] ;  
  
 	 	 	 / /   i f   n o   b l o c k   a r e   p u t   o n   h o l d   - >   e s c a p e  
 	 	 	 i f   ( c o u n t   = =   0 )   { r e t u r n   f a l s e ; }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 s t a t e [ i d ] [ 0 ]   =   0 ;   / /   n u l l   t h e   c o u n t  
 	 	 	 	 s t a t e [ i d ] [ 1 ]   =   ( b a n k _ i d )   ?   0   :   1 ;   / /   s w i t c h   t o   t h e   o t h e r   b a n k  
 	 	 	 }  
  
 	 	 	 / / = =   n o w   w e   w i l l   r u n   t h e   b l o c k s   p u t   o n   h o l d  
  
 	 	 	 f o r   ( i n t   i   =   0 ;   i   <   c o u n t ;   i + + )  
 	 	 	 {  
 	 	 	 	 i n t   b l o c k _ t o _ r u n   =   b a n k [ i d ] [ b a n k _ i d ] [ i ] ;  
 	 	 	 	 _ b l o c k s _ [ b l o c k _ t o _ r u n ] . r u n ( ) ;  
 	 	 	 }  
  
 	 	 	 r e t u r n   t r u e ;  
 	 	 }  
  
 	 	 v o i d   A c c u m u l a t e ( i n t   b l o c k _ i d   =   0 )  
 	 	 {  
 	 	 	 i n t   c o u n t       =   + + s t a t e [ b e g i n n i n g _ i d ] [ 0 ] ;  
 	 	 	 i n t   b a n k _ i d   =   s t a t e [ b e g i n n i n g _ i d ] [ 1 ] ;  
  
 	 	 	 b a n k [ b e g i n n i n g _ i d ] [ b a n k _ i d ] [ c o u n t - 1 ]   =   ( u s h o r t ) b l o c k _ i d ;  
 	 	 }  
 } ;  
 F x d W a i t i n g   f x d W a i t ;  
  
  
  
 / / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +  
 / / |   E N D                                                                                                                             |  
 / / |   C r e a t e d   w i t h   f x D r e e m a   E A   B u i l d e r                       h t t p s : / / f x d r e e m a . c o m /   |  
 / / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +  
  
 / * < f x d r e e m a : e N r t X e t 2 2 z i S f h W t 5 + y c 7 l k 7 Q / B O p 9 N n f e 1 4 R o 6 8 l p J M 7 x 8 d W q J s j m V S Q 1 J 2 N H P y Q P M a + 2 Q L E A B F Q p B k U Z A t R 5 U f 3 T I B 4 l r 1 f V V A A f Q P v c N / p Y c I H e 7 1 4 i g K e l k Y R + n e e / / Q c w / / F R 5 q + J d B c l i H e 4 M w G P b 3 3 q e H z u H e 6 d n 5 0 e d m h / x l H + 6 l 8 T j p B e Q P X A 5 i D z M / u Q 0 y 8 o e O H + p 7 7 7 + H h 0 h F c f g h L U 1 X V J q R l 2 Y o K s 3 M S z N X L A 2 P k S 4 d O Z 2 2 z q p R n i Y t j 4 6 d v X p 5 y J S W Z + X l O T X K s 6 T l 0 f F z a / R X l 5 Z n 5 + V 5 y s p z q C R r N Q o 0 p A W 6 t E C k r E C P F q j X K N C W F W h o t E B D W Y G I F l h H S R x p g V R o k K W s Q C r V q I a a k P m U F E j V G D n K C m S I W k d R P G m B V F G Q p 6 x A q i l 6 D U 0 x p I J t U E 3 R k b I C q a b o N T T F k A q 2 S T V F N 5 Q V S D V F r 6 E p h h T + T U a d l r I C q W D r N T T F k B K K S X V Z d 5 Q V S H V Z r 6 E p B l o 0 h p 6 y A p k F U k d T r A V j a C B l B d I x N O p o i r 5 A l w 1 D W Y F U l 4 0 6 m u I s U D 3 D U l Y g B Q e j h q a Y c s G m A G v U 0 B T T W l R g D U 0 x p Z N i U k 4 x a m i K a S w o 0 K y j K V I a N a k c m n U 0 x V t U Y A 1 N M e U A S w X b r K E p J l p U Y B 3 r S y o 2 F h V s s 4 a m W N I u I z b L d a w v q a Z Y V J f N G p p i y f 1 Z q i l m D U 1 B U j m 0 K K e Y N T T F k v s p d F K s G p p i y d 0 K O o Z W D U 2 x p J O C q K Z Y N T T F k o 8 h F W y r h q b Y U j m 0 W Z d r a I o j L d B h B d b Q F E c 6 y 4 g S v W U r K 5 A S v V W H U 6 Q W r M 3 k 0 F 1 9 e U U K N g 5 b D 6 m h K I 5 U r h 0 6 h H Y N R X H k L a T o Z d d Q F E c 6 h A 4 F G 7 u G o j h S z X O o 5 t k 1 F M W R a p 5 D p c a u o y h S W w l R R b F r K I o t B W y H Y o N d Z 9 1 L q s o u l W u 7 h q K 4 8 g J Z l 2 t Q i i v t s s t W + m p o i i v F B p c t 9 d X Q F F e q K S 5 V P a e G p r h S w X Y p O D g 1 N M W V g g N i B d b Q F E v a Z U T l 0 K m h K U h q b 1 q s h T U 0 x X V k 6 9 e s g b a q 8 i g a O n X 0 x J W V R 8 H Q c V W V R 7 H Q q c M n 0 g l x a Q P d O l o i h X + X t t C t Y 3 j J W 0 i n 2 K 2 j J d I C P Y q F b g 0 t 8 e R 2 E i u w j p Z I 9 d i i 0 O X W 0 B I k B V e L b V M o M 7 w s N s u O k l m m 1 h M p z 1 U l N Y j N S Q 1 F 8 a R D 6 F F + 8 m o o i i k 1 G j z K o F 4 N R f H 0 B U a D V 0 N R P K k Y e l R q v D q K I i c 8 t r t V Q 1 F M q S X n U T r x a i i K J y U 8 j 7 W w z q q X H G y o Y H s 1 F M W z 5 4 7 h 9 / z 5 z T D u 3 e f b 3 6 5 N t r + J J O m I V O L m G + R Z E g / z Z O 3 w X / g N j z 7 0 w y h I S G H m 4 V 4 n 7 N 2 T n z h / P 0 z 9 m 2 G A 2 3 V z q N G 2 B d + y I I l K J e D q w 3 5 5 N x k X G a b d 3 j j N 4 g f + o s s b R p t M e j V J s + C B 1 f M Q 9 4 N h l x a D W 3 D l p 2 l e I q 5 v 5 C f + Q 4 D r x E X G c d L P E 7 T D P V b M K I y i a f v w O K Y 9 f x i w x C h O H v x h X h J + I w 1 I W V m c l B p P G p L 5 2 T h / p L O p i K N 4 M N h 7 H + Z F 4 u b 0 / c w v a v 2 e Z 8 n C j N Z S a i 0 u C 7 + X 9 5 C V h R O H w S A j R e m 6 a e E 8 B n 4 1 H p E H L v a g v + d Z n v w w 4 x 3 A Y / f o J y E Z 9 F I r 8 T D E 4 2 w 0 z t J y 0 S F + x t / D f w b F n 9 / z e n p p n j u X L 0 Q E w + / d 3 y b x O O o f 9 O J h n D B Z + 0 M v / 7 d H R 6 + S Y u T / 8 u H D c z v A Y n L w F I S 3 d 1 l 5 M J A 5 F a s u F o 7 E n 7 Y b Y d m 4 w X M W J A d p N q E D R t + j k Q 9 S u T Q 0 8 h A P x G + 4 s a N L L B l 7 d O D 8 4 Z C 1 M k + Z x l H Q 6 W 1 P H m 7 i 4 W x + m y e V B I f 0 5 3 g 8 S V t J O x g O U 1 Z s y n / j y j u J H w 6 / 3 v l Z W b J 1 n S W E 0 e 1 1 M A i S I O o F V 0 l Y u P u 5 J U A G m + d q 4 9 n m T c q V / F v Q Z z V k J O 0 q H O U 1 6 g Z Z O 3 0 8 P D z q X H f b 7 W a 3 e f H p r N t p d d t N 3 r + M l h U F k 4 p T h w y e N B 5 m 4 Y g O M u m f r v 3 Z 2 m 8 Y 2 p 9 Z P p N X G W A 0 i b L O F R s m p N F 0 t 5 p + l c S D M B P X O A d 5 l k I K p 7 q P i O A O x 0 E 3 / y 9 T 6 / K 0  
 c u X 6 w t P J K w j 3 u H 3 W b J a 6 e d K 6 v j 4 7 6 V y 0 P k 2 l 5 X t e 2 i A 7 D W / D k g 6 8 X O 3 V K Q 0 W T G l Q T C k X G j b w Q T H w 7 e r 8 O e W i / S T j Z Z M e j 6 M 8 m q k k A j h D I T N F E V a R V K 6 i N L d i B t r h B Q V c V d I d O v E 4 X T L 2 O h / 7 U R x G W S o Z f F M c f N 0 k J e P R 7 5 x 8 P D v 5 a 7 d d i H v n h A 0 l G Y X p Z E 3 j l G Z V e c G s W U W 7 z x O f j a Q K 2 T G p 7 H S u j y 6 w 8 G A J W t Y Q c z r H n a s H N s E m I a g o Y A O M x 3 w 0 n V g a + E T G l j w X Z l W n s 2 q S 3 p G Z U t C l Z w w m / t U M H o P h C a e I P O J u m J w G R O a j + 5 w N 1 J o T u g J z g u B j G Y 3 1 T R s W z O r i U k u Y b v r b K P 0 2 S 7 + t 0 m + 7 + K 3 C Q N F L 0 N X A Y z h q / B T 4 v b s G J u p + 8 P N y u 0 X T t I r d 4 r l b Y r e Y t q v f m D K 7 Z Z D / m 2 O 3 l G Z v D e v F m G e 9 I P T q 1 g t p d y u i / C 0 j q n J 6 Q V b 5 v g n n Q w r / R E m K f A J v W N q c H A V z W A W C H Z 9 R 8 b q c x T 2 i n M d n V z S 9 R J z W B s D E U A E m u A n H S e D f n z 0 G 0 R X h u 0 2 j i b k 6 m i h B D Y 9 1 t I E h P 2 r k 1 L 4 a c C D X Q R X g Q B o C 5 K B R 1 W v 7 P S W 6 X h M 4 c C 9 u 8 J N X 8 n r 0 s t e z C 0 6 P z b y O l 3 Z 3 n l s v O D p q H R 2 9 6 u i 8 o p t T o / W 5 j z x t / Z w m a 3 W a D A 5 R L R v G B I f o 1 R 0 i J C z k e i a Y N f R w l 9 w h 4 m b N F z Y c i L W Q 4 M o V a 0 C u d k i i u D h f G P X D X i 5 M 3 R D b C R L l t V g N O B U j Q x j 3 x d N e M 9 C E n 1 0 V O U m X r 8 6 u L 1 q n 3 Z P P W N U / d V g L 2 3 f h I K v Y O D N o Q N 7 9 0 0 / a O / T n 3 B v 4 6 e e f K T i U + q t P + 0 v Z i P d X f 4 v 9 d c X + / g m 9 s 2 b 6 b L B W 8 0 W y c r e N F z V o S o 3 i 4 F k h N N 4 q U w 1 l O p w x r 9 Z n S 1 z 9 n / S Z X l j V a c 3 L t t Q s a 3 I 7 b t 5 o K q c z S w W d W f k g h 4 P J l y n e b p b Q r D U I T V N D Y o Q H a K 8 b l W 4 v d s m J B 1 6 h r i 1 h L g v / s 2 0 Z c 9 3 k / z a 0 B W n P 4 y y L 6 7 X o c M 9 T 3 C / x c P w Q S B f b i t R 2 + E 9 u 5 W r v t M J j m i Z e h + l 9 d f G s e J c n F S p q 8 B T m x 8 y 6 t T T 5 m G h R K Q 9 f B y O j 2 S + 3 S w F + G K R j a J n V j E s 5 J 4 N z 7 W N H 5 X M U Z r J x s c q Z T o M h V Y S K G / D w 0 C E G W 3 o V 0 9 k o O M s i a Z e 3 F 7 j o 0 B 8 2 Y w r c p c a 5 N A N b O p i 0 o m a c p u X 1 W F 0 T c 0 z X B Y o Z c G i e o 3 6 f V F E p h L b D E z J U y q g 0 9 T r A C i s p w a k k z 2 s D M n R 7 f m c N n u U a u y p J W s i n P 6 S / a R n n 4 U 0 8 t w w 9 H + 1 T j I 0 P N 0 G S L R n Y I t + c C v W 8 R U 3 / J h 7 3 7 o I k m F + c X c 3 Y D N O s 8 E r 3 9 X 1 j 3 9 y 3 9 u 3 p W E + z z u t r X n U 7 + M e x n w a S C h F L n k 4 F f t v A V d m V t 6 V T o b P E e V X b X C M / j 7 D N 1 g w f w q y M I f h 1 4 o u R e j m K 5 C o 6 i f y H s F d e p e f Z S o s j F C 2 I 1 B a J f D m L L d L l u k W j e c m E C 9 l m V s V w S f 0 h z / S y 6 0 + k 6 t H r V d 1 / n a q J G e X f B 9 U 9 m / I + S S X D 7 N T r l e Q F k + 9 J M t L m l a Z f J 9 M / z f Y y x i W r d 6 S 4 3 q p U L 6 q 5 r 7 j m M p / N r x p r 4 9 m 3 8 m r / b 3 R t k D 4 / 9 S d l o 9 X N H 3 6 M x 0 k q j i k p J I z G W V D O T 4 x I n C D p j s a 7 k 4 U P 0 t 5 w s 4 i 0 r M P y l N 1 C 8 q x d P u m k 8 S 0 E k p D 5 D y M G g Z p 2 O B U r k n j i R / 1 h c H E q 9 o C k X f r J f V A B R q / 8 E v k 1 I D a 9 S J N 5 l v h h h N U l y n 4 P / K R c h C u k X + J + 3 p U z 2 E I G P O r l Z L F 8 M v 6 l O 4 F K j S x q y G d C t A Y q W d o B H u 5 + J Y s x H e 2 y J 6 4 X A M A T S A f L 0 0 z s i C I x 7 1 0 l t f z q 1 y C 4 r y Q a p U Q u b e U F / S K x k D p h 1 G i l M 6 J X S a a d l S b f h y P S p j 6 r m m w h J E R / 2 C Z I e x i O R v 5 t I K x / X k 7 w Q D 4 w m 7 b U l a M k i Z / y 9 d j j 8 Y S p U W + Y H O c q q d x 9 t R W 4 r 3 a + I / c p f t p m p 1 X R y q u T 9 7 U R 0 c 4 u d l W R J + w e I 2 N D z i p a 0 V n V N F e j i L b S M i v Z a I 1 J h H c N h x X 3 M g l 6 m R / d k r / Z  
 V V W b 8 F z J k + A f 4 z C b F B 7 n j P 9 a M p h X d V / L l A g e L H i w 4 M G C B / t W P N j n O D D L n N c 6 E Q Q G 2 1 G Q H w x Q F U K g 3 v d d M c B e 6 g H L B A g 8 Y T W i 1 L m a R q N c q R S l T f j S F W F i 0 a n g U 4 N P D T 7 1 h n 1 q s + x T k 6 B R h g j Y q b 4 O + h v w q R 0 F P j W x D 3 B T t 9 C p 1 t T v B L u 0 s 8 / z q g 1 b 2 1 K v e j D Q X t 2 r d s G r B q 8 a v G r w q r f b q z Y K p 4 g f E A C / e v X Y d h 6 Z X 3 I p 3 o g z v d T / g e 1 k 2 E 4 G 1 x d c X 3 B 9 3 5 T r 6 / 7 Q r i 9 6 Z d f X 0 i 1 w f e e 6 v h 6 E Q o P L C y 4 v u L y w k f x m Q q H X O Y 8 u v X D h p f z f N c 7 V q W 3 o 7 m w 6 M 6 F b v n S w m Z 3 n s t i 9 4 s b z J g 5 0 1 m k q e O n g p Y O X / j a D v j 0 I + t 5 Y 0 L d m Q N D 3 f B 8 9 / 1 7 v C n d s 5 H h f 2 T P Y h Z s 2 y r 3 e r f s 2 C B b O 3 E q r 9 t a N 1 Y I 6 x b s 3 y E C U L v 0 V W m i + 6 M Y e 3 M P B W 1 h c f g Y X c b z Y R R y W S H S a t t M 3 c a C 5 X 6 m w X u U 6 3 e J W T P W q p u I T G W S Y P 8 W t U Y D V p k V G d O O a Z j x P 0 x T t 6 n y K 6 W 1 s S x X J E E 8 J K v u o B l p P j 4 6 8 E + / 8 X N Q j P E h / 2 J Q G 6 Y p u p E b q L 5 a t c y G 1 w + 6 j / v G u o i 5 W E O A u 6 h e 7 i 9 r R h b h n D S 5 t J K B h b B f t T m + x V 6 9 y B v C u O t 7 V d V G h L L S r x G u u p E O 4 V b d c c 5 5 1 o 3 s u j 1 x 1 X t 9 8 N R W p 0 c X g x 1 W j i 8 F z z V f x 2 y q 7 q 0 X W 9 m n R J t n I A j V S p 0 b i a o p n 7 K w X O P d K U / f 1 y Y g 5 e q T l s 1 u H c 7 b 9 S B O m + 3 s v c M k + U U 4 V 9 z q R Z p 4 M 4 z S g + v l a K 6 H a y x 1 E J Z O b 9 5 h q 7 T M + i e q K E b k a O G X E W d 0 + H Z 7 5 v N j 2 K 7 H z 4 y v x B n b r V 1 Z i S w M l l i n x 3 L P k J t s e b M b i Z q F / m O f P 4 2 c n 0 1 1 p v g 3 8 H 3 + 7 a j c e 3 c b 1 0 a f f z g 6 w 4 m V 5 C 8 X V X o e P y w U v 4 X g 8 G A R J u m z j 8 x l 7 1 k R k C Y y 0 8 k l j m h b 2 l w W B k V 3 T M A 1 v S g F g x Y o s S 5 j d C p + m F R H C p R h J 3 N h r P 7 p l I W L s i 0 2 l t 8 1 K + l n U n / k M V J 5 c D W g j 2 h M k j x R + i i J Y t 2 g F p F u o F N t W 5 G B V k H S X p / M S T v 1 J i y l Q d a 8 / T y 0 f G n j w v 0 l i A 5 5 x 6 K 8 X P 2 A k 4 a j 7 K + v t 9 S v J G A I Z + 9 F k j C T 1 k j h N n 8 I + D a Q s S G c R R i o m d R V H 5 P D r J z G W 2 + J 7 c x t k d N q F t V l Z b P J C R n a F j 3 x s z Z 7 o + f n p y Z F X x x u W E C 3 5 c C N u / j Q 4 z g P C B T B 8 L c L 9 5 Z U J V w c Z A 8 L d B O F 6 Q L j P i C 5 w r O 3 c D N 0 o 4 + r a x h i 3 1 T 6 5 a D a P O q 1 r K R q 6 b E b 9 o Z 8 8 y I 6 X g l u y m 0 y M W / X h w 1 w q 3 u T 1 V K + O 1 L o G S P 2 c A 0 a 7 6 B v p 6 K 0 h N d i z g N Q / L F I j Q O p n n J C x d t K m n h v F b 7 C 9 3 w I w V w F s c w r Y 5 x f N z p k U r G m 1 h A x u m K Q a J k e Q N B 1 e H n W x c N 3 F f R E A y U c p j v 2 k G T w G w y o A M r g 9 n z m 8 D y b 6 L i 1 k Y K 0 5 6 l O 9 9 4 e 0 y 6 k o D m f f e s G I 5 J h J V 4 + / K g 5 f k B u G C h G + S C + i R y o N b w S L y Y U s R f M b Y d o I y x 1 Y a X t B t 7 f H h D Z t / Q W D 7 X Q D w B r A G s B 6 o 2 C t 5 N i O W w H r L 2 8 L q j U B q p 8 L 1 M g V F j t 0 f W e R 2 g S k B q Q G p N 4 o U p t g V q 9 h V l v C l 5 k 8 D + 0 q W F s A 1 g D W A N Y b B W s L z O r a Z r V 4 l Y S y u 5 v e H F L b m 0 B q M j M c q X 8 7 + v S p g c G 1 Y X 6 U 4 z U / E l X B W F z o R 5 P 9 K I A c 8 T j M S 7 8 z G f E d i c v W 6 V m 3 + f X y q A B P c t F 9 c U 6 p u J m U X R W T F b K T j Z O o E U e N o 2 G Q Z I 0 P D Z 7 N J Z u d + F H a i o Q C k D V N O h k n C b v I t J z D 4 D k u g z R l h 6 j K 6 Y i n t 8 n s z 0 0 9 e / D D o b j b i j u b k r c G Y b E d k + d + 9 + Q / A i E B I b 0 y I d n g P a z j P Q i k Z K C d 9 R 4 c 4 K R d 4 C S I E A J O 2 j Q n O c B J a 3 D S T L D l D p O S C 6 Q E j h K Q E p D S + q T k w s p d 3 Z U 7 W 7 h u z 9 j d l T s P C A m 8 J C A k I K T 1 C c k D Q q p J S L r 4 v S v d 2 9 U I L U P b y K a / J y G k U 7 Q S  
 H 5 0 i 4 C N w k I C P 3 g o f G R q s 2 q 2 x a m c K l G Q 4 u 7 p o Z y C g J H C R g J K A k t a m J A S U t A Y l O a Y G l E Q p S Q d K A i 8 J K A k o a W 1 K 0 m H V r u 4 2 k u k I L p K 1 s 6 t 2 B v A R u E j A R 8 B H a / M R n P O v z U e O G G d n 7 m p Y g 2 E C H 4 F / B H w E f L Q 2 H 8 F t B u s s 2 X k a L N k x S r K A k s B F A k o C S l q b k i y g p H W O I y F P j G z Y 2 W U 7 G z g J 3 C T g J O C k t T n J h m W 7 u s t 2 n i Y u 2 + 0 s H z n A R + A j A R 8 B H 6 3 N R w 7 w U d 3 D S M g G P m J 8 t J H r G k g X R T 5 6 P h k R o W R w 3 8 h w Q m N Q o q k p O x n A T u A t A T t t K T v B 3 Q 2 1 v S V L O J d E z i n t K D t 5 w E 7 g O w E 7 A T s p Z i e 4 y K H + z U L C / a u 7 y 0 6 m B u w E v h O w E 7 C T W n Y y N W C n 2 j t N w o E l c 2 c / B G c i Y C f w n Y C d g J 0 U s x M C d q q 9 7 y R 8 U H q H 2 U k H d g L f C d g J 2 E k x O + k Q O b 7 O x 5 W E w 0 z m z g Z G m A Y Q F L h P Q F B A U I o J y g C C W o O g b C F y b 4 c J y g S C A g 8 K C A o I S j F B w X U Q a 1 0 H Y Y k E t a s 3 F J k W E B R 4 U E B Q Q F C K C Q o u h 1 j v c g h d A 4 a i D D X 3 c g i T k V E z F q m J q n e P S n m 3 N 5 V 2 o Q S H z W r Y + t g 8 Y Z M S n g x j i r B k G A j U U W 0 5 x x R 3 P K k A H u G p P K 3 A N L Q M B 9 d A 3 T m a 7 5 A u P W D x D V g b f m V t v I 5 r M v Z p + / o g C 9 J M x t j I 4 Q I y h 1 s 0 4 J Y f j l v w r 1 4 S p + l T 2 M / u p i 8 t U W r F h K L i Z g f 8 + k k c U Z Z 8 I y Q i N n n x w p s Q 9 m 0 Z 2 7 P w d n L k 1 W E N C T O 4 x E Y O s W y T P w l D O M A Q w B D A E L v O E A 4 w x H L H Q n O r S 1 8 W 2 g m K c I E i V q K I X 1 6 V I m A H B S h i I x T h A k U 8 4 / C o u P b k 7 Q R F e E A R Q B F A E b t O E R 5 Q x P I z M p r w C V T L 3 g W K s L T V K W I R F r p T L G y 1 T y 6 a z a N O 6 1 q K h i 6 b U X / o J w / i T j D s 9 O 4 S S l Z 5 G L f q w 4 e 5 R E w l / p H U 2 X 3 k N Y s x G E y 0 i p a 9 F a S 2 N E D q Z y B 1 F a i R Z q F d Q G r 0 1 p A a 7 F l A 6 h 8 W q R E g 9 f J T f c L n Y J C 2 R S E / G 0 T q u W f M n X U C U E u A f X 3 0 6 b c z 2 K 4 E Y C 5 A E Y v A d Z g G Z G b Y 2 w X k E m k m a d U I S b Q 8 g r I o 9 S o c p Z X B 8 + j z o t m 4 l 9 o 7 T W e v X P l p y u O X G S B v I B z T U n H i m o Q z F 0 p C u r R p G M b q H e b g V X D W 2 p B M Z G w a k 5 m w T i w + L C D c B 4 K s X T 3 N Z h m A 1 Y D V L 4 7 V 5 / 5 w O A + r S V o 9 r C Z v y r C a P H 9 d r D Z U Y z X p 0 p v H 6 g H r x J K 9 S 1 t Y 7 7 B 2 9 e J b a 2 P f n m 9 P s J z f T r q d x O 8 H 7 f A 2 I j I x i 9 Z G g d Y n u R R 3 S / X R s x 2 s o E Z e U I O X x P y m 0 S T h Q 0 H y / t + / G 7 q m u f u N 0 8 C P G p f + M I 4 K E P g a 3 H S P + v 0 k S F M u 5 k 9 P T + 9 y 5 z t N B 9 / I L z b y Q / 8 m y O v A I 7 N 3 c N C M b 8 O o c R E N i G Q T r D g 4 Y B n P L t m Z K 6 Y b T P 2 f 8 G i X n p I h O o u I H H X z g 2 N M h e l Z M T J z L P E 0 T E d D f 8 K Q s E V U g O o o S + g W J 9 R w 1 V / v w q x Q g G m G h K E L X 9 Y n U 1 F N 7 X 4 M h j l B 4 a H H N W M l b 2 j 7 D b T f 0 P c b W I O M R h Y 3 e n c E l x u 9 / I W U N + P 3 Y D i M n 7 p H S R I / p U I r c X 2 n k 8 h / C H v d d v d a S O Q 0 0 T 3 3 e 3 x m e f / J k B 2 d d N v j Z F B 9 K 0 f f N O t 2 T i 9 m R + R y k h c 4 L c / I M Z j X d j n 5 E g / x V A 3 D b C K k c t 6 k r x a D 4 R E Y G T Q q 5 T Y + N P B b j Q M s T Q N / P M x S / O C n S / Q B P 0 T 7 l x b 5 v 7 5 / i f I f 5 v 6 l o Z E f 9 v 7 H P I e 7 / 9 H E / 0 f m / i n 5 2 / y Z 0 + 6 0 Z U X l S H N Y 7 d P E B Z V r R f X a t A H a t A l a 0 Q i N N w O / w h q i a d b P S 1 Y Z w U C C k 3 8 b P v l n m X D 1 Z M 2 r J 2 3 h X u Q d 9 j Q t M F 7 A e A H j B Y w X 2 C I F 4 + U F j R c L j J e 6 X 3 V w H Q u W X q j 1 s v h 7 r R B K L o a S / 9 e i u A j S 2 c K M 6 4 Z H n W v J s F j M L M S p o 6 J h B D X N N b q w E p j N l Z e 8 O 7 g 2 v / / 3 c Z p V W 4 C t P s y h v N z H w 0 P c / m 6 n d b U J a F N x 9 g V X c o 4 x a D z 0 3 w i c  
 V R u 8 G M A M 4 d y L s p h m b T 3 8 G g x c l 6 q i g v i L A q M 8 w K i V M O o A M I p 4 O A y j j l u d T u t y E z D l A U y t B l M I o R 8 Y p 2 w N j u U p O p Z X L 8 a U d K t s m G x / u K k N B w O W h 5 s 6 w v f L b W 0 X o k 1 t B G i i 6 K q g e m h i T t G E m x B v A F A g f n 0 5 o L h I A B R n F w 4 a O X P N E 7 3 Y h m r d / D 3 o Z V g r j / 1 k 5 k R Q k f 5 5 h K d C v C H Y y V M / s e u P + b 6 N x t 8 p X X z c O v 5 L 9 2 P z 4 t M Z a y X O Q H A D S d R W 4 2 p L L l e W a S 3 v D s G r D s u D h 8 n g b 1 f X n v l S 7 S K k I t 0 k i Q L C a e U S L / 3 k P i j 7 H s g r v 0 R + F R d B F + 8 6 L A s G r T g K o u z 3 g I 4 x L 8 I V 0 i 9 x P + / K G W w h w y n d 6 O L J Y v k f c b e 5 2 6 Z X G l n U E E b j r N p I M U s 7 w M P d r 2 Q x p q M 9 u 6 F g s p E l C a S D Z Z g g 3 F Q k 5 r 2 r p J Z f / R o E 9 5 V E o 5 S I + z 3 3 R d L p V D J o t M 6 8 v 3 O T a V + l y f f h i D S p z 2 q e q s V 3 i u B Y h K + S s C e V 4 U 0 b s l M N 0 r d X g 6 a 7 Q q B C o E K L V E j f D q O 2 H G d d k f S p z a P Y o K V 6 f E T 5 O m + A x 0 1 n / P y a S m r 5 0 n 2 N J z S D Q S a 5 k Z 8 m X n N b o Z R K q y p i I Y g J O k x o b M I 0 u c 0 N C V J W u / N 7 8 6 z b b j X p 6 N A c X 6 u G L r c B j n 1 q v l a M B 4 O W G Q y x L e C z T b r Z 9 t L 0 o C / 5 g g B O / R j 2 + 0 E k T / v f 3 P o R 0 Y L 0 8 s 5 P s v b 4 5 i u e c t o 9 b j S p t b w d T V E s f N 7 g 0 8 R / a o b R x r d i z W o s f H i o l 3 4 b p d + m 0 n h 5 E l K D e 9 j g X V y y j C h c B K k 7 W 7 O M 6 A w s 7 Q W 3 a x 0 E N j z Y 8 G C A v A E b f t X l I z D j Q Y v A j A c z H s z 4 1 z X j E Z j x m z L j z a o Z b + j W r p r x c 2 + S Q S y 6 R Q A l 9 W K u 5 J Y N o u 1 R L 8 B o y Z v y B r a K c g z D r W 6 M g q S R s X Y v k V x N j B f e j v 2 i G y 3 Q X e M l B d e A U D x 1 4 c I 6 N + p H c R h l s j E x R b f C I f Y M d i s 6 V / w r o n h M Z m 5 Z k 3 V s Y 5 F 2 5 j Q a + K p L l w T U w 5 U B o X a L b / 7 R q w j l / c g B w Y 4 J K K Q u I H g N F C K f S t 4 6 F G o 3 N 4 Z C J q D Q 4 s A a Y 5 d Q y H r B t X i y / H L F 1 9 t h R R 7 W E m F F f u U V e a s U V c M t V V i S B z W C J X l Y k l + y J F / h 7 d k 1 + X K y s C h P V L Y 3 T E 7 8 f p A d D 8 v r 9 r A w v 5 r x b c H C / G Y W 5 m 0 L b a n V / t L L 8 v b L W v T t J l j 0 Y I q A R a / C o i 9 W f c C i B z U C i x 4 s e r D o t 9 6 i t 8 G i 3 4 x F b 1 k W W P S 5 R e + 8 o E W f 0 / X J x 7 O T v 4 J Z D / Y I m P X r m v V U l 8 C s B z U C s x 7 M e j D r 3 4 p Z 7 4 B Z v x m z 3 g S z n p n 1 c G v x 6 w Y A 5 j e U a I W N t m V R g B X D U T 2 + w e 3 E S + 7 r M 3 c p C n D u 5 c R 4 K u g l u l 9 Y P x G / t L 4 a h N T t t L o 0 n N 9 m G i Z x o 3 T c z z h f S f C z L A l v i A X a b R 3 / B W v Q P A y j 5 s D U b 8 E j F z F v A v + U B h a S L 4 k k 8 S h I 6 D c / i D r h O q 6 u W 1 f d q + u L k z N U f M s y v I m b w W M w n P 3 W R K c 5 I j Z s n s q / J / F O F + / / X Q Y E l Y H T h Y F j e z 1 k 4 G g E M h 8 4 / W U H b r p / u 6 U D Z 5 Q G r g S K u c S d l A f O e M G B m 1 0 m 2 9 L R M 6 s I n A + U q W a F Y / n n R k r t s C T t s F 6 m H e r J U 8 W d 2 c S Q w 7 Z G O J h 8 m V L I Z l n U W t E 9 0 P J l + P L X X 9 Y / t 2 j z X j c q 3 V 5 8 d F E T 7 s 5 x t S 1 h Y w v / s 2 2 R j f N T j f m / D b k O r g a u w + u 6 D j o / P H T W b H a 3 5 x w j + V A d t y 8 E y 0 w 5 C r o a u B B L P o 7 t C l 8 O U H b n 9 z Y 6 E S 4 C U H r V Y 9 V V U N q e Y 4 1 l U B K 8 H v W g h A C U F o O S I 3 4 2 7 s c G J R 1 A 6 X V B y a 4 s s n Y J N m 0 N M O n l R Y V 2 Z V l B P T L p g E z L P m i J d g m Z j B e M 6 n L I n i 8 c v Y Z Q F I j o q r 3 O S N g C z X G u I b A L t A k C u y C w a 2 O B X X Y e 1 3 U d 9 C G i q 6 7 9 b U B E 1 2 Y i u n R k b + 2 S w g v H d L n m C x v 1 c P o a z B A w 6 h U Z 9 T M h O W D U g z a B U Q 9 G P R j 1 2 2 r U m 2 D U b 8 i o 1 8 C o 5 0 b 9 S 9 6 R S v U e D m C D L Q K W / X q W v V E 5 g N 0 W g s b B t A d 1 A t M e  
 T H s w 7 b f V t I e r U j f 1 D T M P T H t u 2 t s r H n y c H 1 / / O i c f q 4 E 9 W 3 3 0 c X 4 U 8 O u c f a x u n 2 z 1 4 c c F c Y q v d P x x 1 k u F 8 4 8 7 c / 7 R t e H 8 4 4 u e f z R 1 D c 4 / l m n b W R j V X 9 e V w D V e + W l 6 6 X 8 j D k q 6 V z b R F G u Q k u u F t O L L p W z V 8 S 1 8 u F Q v f b j 0 x k + e c f j X E 6 1 V Y 1 e / X O q 6 b 1 3 u X Z D 7 5 8 q 9 q Y P c c 7 n 3 X n A H p m R e S n d d m k f H Z 0 3 Y d Y F l 4 h 9 / 1 + V 1 j k G + 7 C q x m Q / B 3 1 i b d I 1 h A 3 7 2 e + U Z B Y k O R i 0 1 X h s q f c i v d b X 8 m C a u / B w X y O b w C C P + s L T Q S 5 L a 4 T + D y k q 7 s A B e G t p 8 q T p h l E 7 U D 9 f 7 6 e y 6 2 z w 7 7 3 Q / X + E B n G Y 8 i n p 3 c Z H x 6 N P J x 5 a Y U b y F V M t X v 9 v 3 k + N h G W F 3 d C H b U 7 2 Q T Y V w u x a y N b U L 2 b y L S 0 w k J J w Y t X f 1 M l F P A w s J L C S w k M B C e g 0 L y d y I h W R O L a T j V q f T u g Q j 6 Y c 1 k j w N j K R N G U l G d R 1 J R z t r J M 2 9 o c y E y 4 B k l w H 9 s u g y o E 3 7 v D l A J n G a P l X D o p Y I g G J c U n G f G H 7 9 B B s f Y R b G 0 R t Z r h a b v O x + 1 u r + p I U 1 b S t W q s / P T 0 + O P E U 3 9 7 i E c E O f W g o E T n S A k 5 X g 5 F f F c L K q g b g d i K I D o j x n 0 7 e 6 s m M 7 O 4 E o B i A K G C i r w Y k B c P K M m 5 h R 1 Q e y X G 0 X 4 M Q E O A E D Z W V E M Q F R l i O K + H X q H T F Q L E A U M F B W g x M L 4 O Q Z R 7 I s w d 9 B 1 i 7 A i Q 1 w A g b K y o h i A 6 I 8 4 z Z 1 0 U B x f 3 x E o Y e + 8 Y h k Y X R L 2 + 7 w 5 v i 9 L H w M u v P k k B Q + S m I S z d L l B 9 4 s o h 4 2 8 m y k O Z q D M f r g B o v + A Z W p g y g a f D v I R g f p 8 C B L D z B W H P h Z c j A M H 0 L 6 Z Y R y i R k L k L G J a J M z c n y 7 s o d F s j v E 7 R / 7 t 3 x X 9 / J / m i Y f C h K L 0 + 0 l Q R 6 S Q x x Z X c N t M Z B r I 6 e c 5 S E / U z Q v y 4 N / G / a 6 W P p o x S Z Z h d S 8 4 l R m m I Z 4 / r v D 8 C b x k 0 m X T N p o R n 9 I 9 A j P m S v Z v H x E 5 D B E J t 1 0 G n K B h 8 L W e J / y j 0 d 0 k z E T u X w T V S v J 2 S A h G t 0 / 1 N 5 p G q I v Z z F 7 g A h t o D m Z Z 7 N r 9 A V 9 7 g v z 3 j B m 3 s i 7 + b e j z 5 / b / D o D / g 6 i 0 I h l e 5 x i 8 A 2 T b O w P 8 W j H I 9 7 3 K J 6 O d S k 1 D 3 z K t Y j q P x l i U k S A R + 8 2 i H o T S S E k j 5 D e T e h p y X K c j 5 j F 7 1 f j f P C P 4 D G I s p R I T h F O w H X B K 1 J 7 k x 6 e 7 x G j M L b Z T Z I j A h n d d I R F s 9 / N Q b N y F t G Y Z m G Y N 0 0 k x 1 m z A M s L F p G 7 + K m L y T f s M b A s F Y H H 8 z b x R 3 f d O A l x W / w C q X G O T j z q x M d x l t G Z I e F V X N W w f o V J k Z m h d 0 5 A o 0 l S g R S m P k H a S 8 K R 8 A J B 0 j C 6 L z 3 B z X n E z F D O V j A b 7 m N E s R J x u + W 4 b M U U 1 E U e U 8 7 D O F 8 C h X 4 8 v p l e D i F v k s X o n U e v G E W A U g X B d d 4 E c i h d 0 g R 6 V n 3 9 J h T h D D r 5 h q y 0 q n Z T c V X k y D b / t p V Y X z l t I 5 X K x r O c p r T S P B j x + u i i y T 6 Y I 1 Y s p q u t H P G P 2 8 6 r X c y g t H q L d W 2 2 3 m m K 0 g p t 3 p v Z G k t J q o W q 8 O E l Q l X y 7 x U L V d n U l w l V 1 R V Q W b l O C 2 e X F 0 j 6 P Z t D b Q O s U v F z h 0 C W S b l y l T 6 c L l e u S o a N V M + u 4 J h f f Z F h U 9 A y v / p K B r X V O 5 W x 5 X e 3 z D R C n m 0 j T R H u Q p n X l J k r U x Q 3 R f J l d V l T p B 9 g V 9 k U l 3 V 3 2 Q z N y b e Z x i y b o z n 5 1 D b G m 3 L u 4 m m a l 1 F h c y h L + 9 j 4 5 z 4 / i X H 1 c Q W V l h z u m Y X 1 L X e 7 p + s T j s m W Q P g K h u f Z t H K 2 1 k S W M B B t 9 R 1 b G 8 C V 6 s Z 7 4 a D 1 4 Z 4 + p z 8 G L l 1 v f G s c f / 6 9 8 U f / Y f S + Q a y X x n 8 3 0 H 8 2 z v 4 x D r P J L z f J r / n K p C X r j P X s z r g 6 e i 9 8 d l P T x N 4 g T + y N n q / Z C L 0 x 5 v U G v 3 q M Z + C + Q X w 1 1 q F O 4 o f Y c b l t t H F L / h j d p K P 3 e X 8 c W X + c 5 / f H N c X + W E J 3 L N O d 6 Y 7 t C N 3 R s Q S a j Y N G v g 7 b y B I f 9 6 k R R 4 0 k I L 7 V N F h f 6 C r S c N X t I G v 0 + P p X  
 2 s j i R i 8 v 5 W Y 8 S V n v 0 2 A 4 z M s 7 Q U W R 7 + g o N M j U / o S f f 2 i c x N E g T B 5 y H 7 G B G o X 7 + X M x X t + r 7 h 6 L 5 X 7 G I t K z 1 k i + / z 9 d V U F j  
 : f x d r e e m a > * / 