{ Indicator _Position.RS Purpose: Show position, average price, P/L %, P/L $ Discussion: To minimize processor demand, I would recommend the following settings based on the RadarScreen interval settings: If DAILY: the formatting option box under the General tab called "Update value intra-bar (tick-by-tick)" should be checked and the CalcSeconds input parameter set to the largest number of seconds the user can tolerate waiting for position changes to be reflected in the display. If IntraDay (5, 10, 15 min, etc.): the formatting option box under the General tab called "Update value intra-bar (tick-by-tick)" should be un-checked. When this is un-checked, the indicator will update at the end of each "bar" for the interval selected, regardless of the setting of CalcSeconds. Author: Mark J. Krisburg Last Updated: 02/16/08 02/17/08 corrections to formulas made, increase efficiency by bypass calculations if Posn = 0, add TotalCost and MarketValue information. } inputs: CalcSeconds(60), string AcctNumber("12345678"); vars: PlotColor(white), Posn(0), AveragePrice(0), Net(0), NetPct(0), ProfitLoss(0), TotalCost(0), MarketValue(0); if _TickSeconds(CalcSeconds) > 0 then begin Posn = GetPositionQuantity(Symbol,AcctNumber); if Posn <> 0 then begin AveragePrice = GetPositionAveragePrice(Symbol,AcctNumber); TotalCost = GetPositionTotalCost(Symbol, AcctNumber); MarketValue = GetPositionMarketValue(Symbol, AcctNumber); Net = (Close - AveragePrice)*Sign(Posn); if AveragePrice <> 0 then NetPct = Net/AvgPrice*100; ProfitLoss = Net*AbsValue(Posn); end; end; if Posn <> 0 then begin // display only if position non-zero Plot1(AcctNumber, "Acct"); Plot2(Symbol,"Symbol"); Plot3(posn,"Shares", black); SetPlotBGColor(3, iff(Posn >= 0, green, red)); // position background color green for Longs and red for Shorts Plot4(AveragePrice,"Avg Price"); Plot5(NetPct,"Net %", iff(Net >=0, green, red)); Plot6(ProfitLoss,"P/L", iff(ProfitLoss >=0, green, red)); Plot7(TotalCost, "Tot Cost"); Plot8(MarketValue, "Mkt Val"); end;