Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Show PnL next to Active Trade markers in Chart Trader
Collapse
X
-
NinjaTrader_ChelseaB and Adnoker
Thank you both for getting this done.
Two requests if I may:
1) Can there be an option to remove the ATM name. It interferes with the chart especially when additional ATM's are added.
(Or can you provide what script to alter in the code)
2) Can the PnL at each profit target and Stop be repositioned to be underneath the trade marker as per Adnokers chart example in post 13.
Again many thanks
Last edited by dj22522; 02-12-2023, 06:45 PM.
Leave a comment:
-
Hello Community,
I've made these modifications to show the PnL Sum for all quantities on stacked orders.
Uploaded to the User App Share.
This indicator serves to provide labels for Atm strategies that are present on your chart. Each new Atm strategy will rotate through the colors defined in your Brush Collection. Simply add to a chart, select the data series you want to have labels added to, choose your font and add all the brushes/colors you want […]
Leave a comment:
-
Here is the code for stops that calculates for each distinct stop, and appends PnL correctly (even if stacked). You can replicate the same for Targets.
entry price is the avg price from the Positions instead of Orders.
ticksize is the pointvalue - order.Instrument.MasterInstrument.PointValue;
----------------------------- code -------------------------
List<double> stopsList = new List<double>();
foreach (Order order in atmDictionary.ElementAt(i).Value.stops){
stopsList.AddRange(Enumerable.Repeat(order.StopPri ce, order.Quantity));
}
stopsList.ForEach(a => {possiblePnL = (a-entryPrice) * ticksize * stopsList.Where(b => b.Equals(a)).Count();
SharpDX.DirectWrite.TextLayout textLayout = new SharpDX.DirectWrite.TextLayout(NinjaTrader.Core.Gl obals.DirectWriteFactory,
possiblePnL.ToString("C"), textFormat, ChartPanel.X + ChartPanel.W,
textFormat.FontSize);
float x = (float)(ChartPanel.X + ChartPanel.W - offset);
float y = chartScale.GetYByValue(a) + textLayout.Metrics.Height/2;
SharpDX.Vector2 textPoint = new SharpDX.Vector2(x, y);
RenderTarget.DrawTextLayout(textPoint, textLayout, textBrushDx, SharpDX.Direct2D1.DrawTextOptions.NoSnap);
textLayout.Dispose();
});
Last edited by Adnoker; 02-08-2023, 04:01 PM.
Leave a comment:
-
Hi NinjaTrader_ChelseaB,
This seems like a very good indicator!
Please add my vote to updating it to display the correct stoploss values.
Thanks
Leave a comment:
-
Hello Dejavu7629,
Welcome to the NinjaTrader forums!
The string currently uses "C" for currency.
atmDictionary.ElementAt(i).Value.Name + " PnL: " + possiblePnL.ToString("C")
You would need to change your windows regional settings to use a different currency symbol.
How can I change the default currency in Excel? In this tutorial we'll show you how to change the default currency format in Windows 10.
Or you could use a different string and just type in the symbol you want.
Leave a comment:
-
-
Hello GBF_PAT,
The script is an indicator. Download, import, then add the indicator to a chart in the Indicators window.
To import a NinjaScript into NinjaTrader 8 do the following:- Download the script to your desktop, keep it in the compressed .zip file.
- From the Control Center window select Tools -> Import -> NinjaScript...
- Click the Desktop icon on the left to navigate to the desktop
- Select the downloaded .zip file -> then click Open
- NinjaTrader will then confirm if the import has been successful.
Below is a link to the help guide on importing NinjaScripts.
https://ninjatrader.com/support/help...-us/import.htm
- Likes 1
Leave a comment:
-
-
Hello dj22522,
Thank you for your reply.
At the current time it's not designed to handle that. While we may make further improvements to the indicator available at some point, I cannot give any kind of ETA on when we may have the bandwidth to accomplish your request. I will note this for future improvements and will work on that as time allows.
Please let us know if we may be of further assistance to you.
Leave a comment:
-
Hello NinjaTrader_Kate
Can the indicator you posted above at #2 be improved on to correctly total orders when they're moved to the same price re: my post #3.
Many thanksLast edited by dj22522; 05-26-2022, 12:53 AM.
Leave a comment:
-
NinjaTrader_Kate thanks for the response! I'll check that out. and dj22522 thanks for adding on the note about that PnL issue on moving the stops!
Leave a comment:
-
The PnL is correct at each price level:
But the PnL is incorrect if moving all orders to the same price:
If I may ask:
Can the ATMStrategyIdentifire indicator be made to show the correct total PnL for all orders at that price ?
Many thanksLast edited by dj22522; 05-13-2022, 10:24 AM.
Leave a comment:
-
Hello,
Thank you for your note.
I suspect this version of our publicly available ATM Strategy identifier script may be of use. I've attached it below. fi you submit an ATM strategy order, when the entry fills the stop loss and profit target will display the current PnL that would be taken at those levels.
Please let us know if we may be of further assistance to you.Attached Files
- Likes 2
Leave a comment:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by kinfxhk, 07-14-2026, 09:39 AM
|
0 responses
131 views
0 likes
|
Last Post
by kinfxhk
07-14-2026, 09:39 AM
|
||
|
Started by kinfxhk, 07-13-2026, 10:18 AM
|
0 responses
106 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 10:18 AM
|
||
|
Started by kinfxhk, 07-13-2026, 09:50 AM
|
0 responses
87 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 09:50 AM
|
||
|
Started by kinfxhk, 07-13-2026, 07:21 AM
|
0 responses
107 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 07:21 AM
|
||
|
Started by kinfxhk, 07-11-2026, 02:11 AM
|
0 responses
87 views
0 likes
|
Last Post
by kinfxhk
07-11-2026, 02:11 AM
|

Leave a comment: