<\/a>\n<\/p>\n_SECTION_BEGIN<\/span>( <\/span>"USING A TRADE COMPOSITE" <\/span>);\rfunction <\/span>DeleteComposite<\/span>( <\/span>CompositeName <\/span>)\r{\r global <\/span>Ticker<\/span>;\r <\/span>oAB <\/span>= <\/span>CreateObject<\/span>( <\/span>"Broker.Application" <\/span>);\r <\/span>oStocks <\/span>= <\/span>oAB<\/span>.<\/span>Stocks<\/span>();\r <\/span>oStocks<\/span>.<\/span>Remove<\/span>( <\/span>CompositeName <\/span>);\r <\/span>oAB<\/span>.<\/span>RefreshAll<\/span>();\r}\r\rfunction <\/span>AddTradeToComposite<\/span>( <\/span>Ticker<\/span>, <\/span>Action<\/span>, <\/span>LMTPrice <\/span>)\r{\r global <\/span>Ticker<\/span>;\r <\/span>BI <\/span>= <\/span>BarIndex<\/span>();\r <\/span>LBI <\/span>= <\/span>LastValue<\/span>( <\/span>BI <\/span>);\r\r if ( <\/span>Action <\/span>!= <\/span>"" <\/span>)\r {\r <\/span>SignalArray <\/span>= <\/span>Nz<\/span>( <\/span>Foreign<\/span>( <\/span>Ticker <\/span>+ <\/span>"~SignalArrays"<\/span>, <\/span>"V"<\/span>, <\/span>False <\/span>) );\r <\/span>BuyPriceArray <\/span>= <\/span>Nz<\/span>( <\/span>Foreign<\/span>( <\/span>Ticker <\/span>+ <\/span>"~SignalArrays"<\/span>, <\/span>"O"<\/span>, <\/span>False <\/span>) );\r <\/span>SellPriceArray <\/span>= <\/span>Nz<\/span>( <\/span>Foreign<\/span>( <\/span>Ticker <\/span>+ <\/span>"~SignalArrays"<\/span>, <\/span>"H"<\/span>, <\/span>False <\/span>) );\r <\/span>ShortPriceArray <\/span>= <\/span>Nz<\/span>( <\/span>Foreign<\/span>( <\/span>Ticker <\/span>+ <\/span>"~SignalArrays"<\/span>, <\/span>"L"<\/span>, <\/span>False <\/span>) );\r <\/span>CoverPriceArray <\/span>= <\/span>Nz<\/span>( <\/span>Foreign<\/span>( <\/span>Ticker <\/span>+ <\/span>"~SignalArrays"<\/span>, <\/span>"C"<\/span>, <\/span>False <\/span>) );\r\r switch ( <\/span>Action <\/span>)\r {\r\r case <\/span>"BUY"<\/span>:\r <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] = <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] | <\/span>1<\/span>;\r <\/span>BuyPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>LMTPrice<\/span>;\r break;\r\r case <\/span>"SELL"<\/span>:\r <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] = <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] | <\/span>2<\/span>;\r <\/span>SellPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>LMTPrice<\/span>;\r break;\r\r case <\/span>"SHORT"<\/span>:\r <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] = <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] | <\/span>4<\/span>;\r <\/span>ShortPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>LMTPrice<\/span>;\r break;\r\r case <\/span>"COVER"<\/span>:\r <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] = <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] | <\/span>8<\/span>;\r <\/span>CoverPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>LMTPrice<\/span>;\r break;\r\r case <\/span>"REVLONG"<\/span>:\r <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] = <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] | <\/span>8 <\/span>| <\/span>1<\/span>;\r <\/span>CoverPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>BuyPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>LMTPrice<\/span>;\r break;\r\r case <\/span>"REVSHORT"<\/span>:\r <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] = <\/span>SignalArray<\/span>[<\/span>LBI<\/span>] | <\/span>2 <\/span>| <\/span>4<\/span>;\r <\/span>SellPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>ShortPriceArray<\/span>[<\/span>LBI<\/span>] = <\/span>LMTPrice<\/span>;\r break;\r }\r\r <\/span>AddToComposite<\/span>( <\/span>