Support Board
Date/Time: Thu, 28 Nov 2024 11:05:33 +0000
Post From: How to display Daily Breakeven Line??
[2023-05-12 03:01:23] |
User61168 - Posts: 403 |
Hello SC Users, Wondering if anyone can help me figure out what is wrong with this logic. I am trying to implement a horizontal line on the chart to display where my open position would breakeven for the day when I have floating PnL and Realized PnL from past trades taken intraday. My knowledge is limited to simple alerts so I am hoping use of "Spreadsheet Formula" study would do the trick for NQ emini. I have the following Studies: ID7.SG1 = Position Qty ID9.SG1 = Position Average Price ID10.SG1 = Daily Profit/Loss (this is my realized pnl in Points ID40.SG1 = Spreadsheet Formula Study (mentioned here... Spreadsheet Formula ) with this formula below, Number of Bars to calculate = 1000 and Draw Zero values = Yes =OR(AND(ID7.SG1>0,C+((C-ID9.SG1)*ID7.SG1+ID10.SG1)),AND(ID7.SG1<0,C+((ID9.SG1-C)*ABS(ID7.SG1)+ID10.SG1)) ) There are no syntax errors and no horizontal line is created on the chart. What am I doing wrong? is there a better way to know how far I am from breaking even for the day to exit my trades and stop trading? I don't have ASCIL or "spreadsheet for trading" knowledge. I would really appreciate your assistance. Edit: Please know that my realized profit could be +/- and my floating profit could also be in +/- above or below my realized profit. I scale in and out of trades so ID9.SG1 as my Average Price line is always accurately displayed on the chart. My Simple alert automated trading strategy will use this DayBE line to close all positions when C=dayBE and stop auto trading until session close. Edit1: Perhaps some more clarity on what I am trying to achieve. When C touches the DayBE line, my realized pnl + floating pnl should be 0 points (ignoring trading costs). This will allow me to place my SL or TP near DayBE line and avoid watching charts when trade is open. In essence, I need to draw a line at C+/- "NPL" (the value displayed in the trade ticket window) automatically when a trade is open. Date Time Of Last Edit: 2023-05-12 04:20:38
|