NexusFi: Find Your Edge


Home Menu

 





Accessing the clipboard from within an indicator


Discussion in NinjaTrader

Updated
    1. trending_up 4,108 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
Tempo
Los Angeles
 
Posts: 8 since Feb 2011
Thanks Given: 4
Thanks Received: 0

I am wondering if anyone has tried to access the system clipboard (ctrl-c, ctrl-v, copy, paste) from within the code of an indicator to either obtain values to use in calculating the indicator, or to paste graphic objects directly into a chart, since lines, rectangles, and other graphic objects can be copied and pasted into a chart manually. I imagine it might be something like overriding the plot method, which seems to be an approach some use to plot to regions of the chart not accessible by the normal draw and plot methods. What seems to be available in the NinjaScript editor of the System.Windows.Forms namespace seems to be either a subset of, or alternative to, what's described in the MSDN library. Any thoughts or guidance in the form of examples or code snippets is much appreciated. Thanks, Tempo


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Building a free browser DOM/SMC simulator - need some ad …
Platforms and Indicators
No book, only a stair: journaling fills where price move …
Cryptocurrency
AI for Traders — Agents, Memory, Tools & Real-Worl …
Elite Quantitative GenAI/LLM
Bitcoin’s 2022 low, 2025 high and 2026 low so far arou …
Cryptocurrency
[WTS] ATAS Lifetime ULTRA license – EU buyers only – …
Platforms and Indicators
 
  #3 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,375



Tempo View Post
I am wondering if anyone has tried to access the system clipboard (ctrl-c, ctrl-v, copy, paste) from within the code of an indicator to either obtain values to use in calculating the indicator, or to paste graphic objects directly into a chart, since lines, rectangles, and other graphic objects can be copied and pasted into a chart manually. I imagine it might be something like overriding the plot method, which seems to be an approach some use to plot to regions of the chart not accessible by the normal draw and plot methods. What seems to be available in the NinjaScript editor of the System.Windows.Forms namespace seems to be either a subset of, or alternative to, what's described in the MSDN library. Any thoughts or guidance in the form of examples or code snippets is much appreciated. Thanks, Tempo

This is what I use in one of my strategies:

using System.Windows.Forms;
...
if (Clipboard.ContainsText (TextDataFormat.Text)) {
string str=Clipboard.GetText(TextDataFormat.Text);
}


Reply With Quote
Thanked by:
  #4 (permalink)
Tempo
Los Angeles
 
Posts: 8 since Feb 2011
Thanks Given: 4
Thanks Received: 0

Thank you for the speedy reply, Monpere. I will give it a shot in my indicator, and report back. If anyone else has thoughts, I would appreciate them, too.
Again, thanks
Tempo


Reply With Quote
  #5 (permalink)
Tempo
Los Angeles
 
Posts: 8 since Feb 2011
Thanks Given: 4
Thanks Received: 0

monpere,
That worked very nicely. Thanks.
Tempo


Reply With Quote




Last Updated on February 7, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts