Looking for average price position line upper study indicators

evanevans

evanevans

Member
Can somebody please point me to some average price position line upper study indicators? I tried searching, but just could not turn up a result. Thanks!
 
Last edited by a moderator:
T

tlebouef

New member
Or perhaps something in this code >> http://box5176.temp.domains/~markexm8/dev/forums/topic/track-your-positions-on-your-charts/

Code:
*********START COPY AND PASTE ON NEXT LINE******************

# CDC_Position
input Name = “©<2018>_Position”;
input ShowName = no;

######################################################################################
# DISPLAY LABEL FOR COMPARISONS
######################################################################################

AddLabel(ShowName, Name, CreateColor(15, 125, 15));

#
# TD Ameritrade IP Company, Inc. (c) 2011-2018
# Copyright (c) © <2017-2018> <Clarence Carr>
#
# All Rights Reserved.:
#
#THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.
#
Input ShowPosition = yes;
Input ShowPositionDetails = yes;

def Totqty = GetQuantity();
def openCost = Totqty * GetAveragePrice();
def netLiq = Totqty * close;
def netliqpercent = (NetLiq-NetLiq[1])/NetLiq[1];
Def Display = If (GetAggregationPeriod()==AggregationPeriod.Week or GetAggregationPeriod() ==AggregationPeriod.Month or GetAggregationPeriod() ==AggregationPeriod.OpT_EXP) or !ShowPositionDetails then no else yes;

plot PurchasePrice = if GetAveragePrice() == 0 then Double.NaN else GetAveragePrice();
PurchasePrice.AssignValueColor(If Totqty >0 then Color.DARK_ORANGE else Color.Blue);
PurchasePrice.SetLineWeight(3);
PurchasePrice.SetPaintingStrategy(PaintingStrategy.Line);
#PurchasePrice.SetHiding(!Display);

#plot ManualOpenPL = netLiq – openCost;
def AutoOpenPL = GetOpenPL();

#AddLabel(Totqty and Display, “Qty: ” + Totqty + ” AvgPrice: <b>” + Round(PurchasePrice,2) + “</b> NetLiq: ” + AsDollars(Round(NetLiq,2)) + ” TotCost: “+ Round(openCost,2) +” TodayPL: ” + AsDollars(AutoOpenPL – AutoOpenPL[1])+ ” OpenPL: <b>” + AsDollars(Round(AutoOpenPL,2)) + </b>”,Color.Dark_Gray);
AddLabel(Totqty<0 and ShowPosition, “SHORT QTY: ” + Totqty + ” @” + AsDollars(Round(PurchasePrice, 2))+” NetLiq: ” + AsDollars(Round(NetLiq,2)),Color.Blue);
AddLabel(Totqty>0 and ShowPosition, “LONG QTY: ” + Totqty + ” @” + AsDollars(Round(PurchasePrice, 2))+” NetLiq: ” + AsDollars(Round(NetLiq,2)) ,Color.Dark_Orange);

AddLabel(Totqty and Display, ” AvgPrice: ” + AsDollars(Round(PurchasePrice, 2)) , IF AutoopenPL >=0 then Color.Dark_Green else color.Red);

AddLabel(Totqty and Display, “ThisBarPL: ” + AsDollars(AutoOpenPL – AutoOpenPL[1]) + ” OpenPL: ” + AsDollars(Round(AutoOpenPL, 2)) + ” (” + Round(((NetLiq-OpenCost)/OpenCost)*100,2)+ “%)” , IF AutoopenPL >=0 then Color.Dark_Green else color.Red);

AddLabel(ISNAN(Totqty) and Display, ” No positions currently held.”, Color.Dark_Gray);
 

Similar threads

Top