+1 888 340 6572
MultiCharts Project Management
Go to the previous open issue
Go to the previous issue (open or closed)
Please log in to bookmark issues
Open Feature request MC-211

Allow plotting in signals

Please log in to vote
Please log in to vote
Go to the next issue (open or closed)
Go to the next open issue

Currently, plotting is only allowed in indicators, not signals. You will receive a syntax error if you attempt to add a "plot" statement within a signal.
When I'm developing and backtesting a new system, I'll often want to plot data, such as trend lines. Under the current system, I need to have an indicator to do the plotting, and a separate signal for the simulated trade execution. This has two downsides:
First, I might need to have redundant code. For example, if I write a custom algorithm to plot certain information, I will either need to copy/paste that code into both the indicator and the signal, or move that code into a function that's called by both the indicator and the signal. Under the first scenario, I have to manually keep the two sets of code in sync. Under the second scenario, I have to have three separate files just to plot.
Second, I have to keep the parameters for both the indicator and the signal "in sync." For example, if I change the length of a trendline in a signal, either manually or through optimization, then I'll have to enter those same parameters manually into the indicator.
This could be avoided if I insert code for plotting within the signal itself. Then I wouldn't necessarily need to have a sparate indicator.
I assume that this behavior is an artifact from compatibility with TradeStation and EasyLanguage. However, adding the ability to plot within a signal wouldn't be a "breaking" change, because it would only be adding an optional feature. People who want to plot within a signal could do so, but existing EL/PL code would work just fine, including existing signals and indicators.
If this ability is added, it would also be nice to create a toggle box in the "properties" for the signal to the effect of: "Plotting: On/Off." If "Off" is selected, then the plotting code would be ignored. This would allow people to enable plotting easily during development and testing of a strategy, but disable it during real-time execution, without changing the code.

Steps to reproduce this issue

Add code for plotting in a signal.

Comments (12)
user-offline.png  janus
Mar 06, 2011 - 18:04

Agree 100%.  I have the same issue of repeating lots and lots of code.
I'm using a system where I insert commented lines in an indicator that are
meant for a signal study.  I then save it as a text file and run a program
that uncomments these lines and removes other lines to form a file for import
as a signal.  I think it's time to remove the distinction between an
indicator and a study anyway to avoid such annoying steps.

Another approach is to allow a signal to call an indicator study as if it
were a function.  All variables in the indicator must be visible and
accessible by the signal study.  However, I prefer the other approach and merge indicators and signals.

user-offline.png  mechtrader
May 09, 2012 - 09:50

Plotting from signals would be very useful for signal development. It is very annoying having to set settings in multiple locations, and annoying to have to wait on the calculation of redundant code.
It would also be good to be able to plot these indicators on multiple subgraphs, in case there are quite a few of them.

user-offline.png  swz168
May 16, 2012 - 14:33

100% agree

user-offline.png  Guest
Aug 09, 2012 - 19:14

100% agree too.
Very strong request. ORDER BY 1-- wool

user-offline.png  JoshM
Aug 15, 2012 - 07:11

Good idea; this will make backtesting much more convenient and productive instead of having to fiddle constantly with settings.

user-offline.png  jimpe
Oct 20, 2012 - 16:55

I fully agree!
A lot of time is wasted due to the need of parallel coding and configuration of both indicator and signal.

user-offline.png  PatrickSocal
Jun 04, 2013 - 17:56

I've been using Deltix/QuantOffice and MATLAB for a long time now... evaluating MC.NET as an alternative. An important part of the idea generation/development/debug process is charting the computed values. 
IMHO, this feature is more than a nice-to-have...  It's a major need.

user-offline.png  PatrickSocal
Jun 05, 2013 - 02:48

If this is implemented, I would hope it to have the following enhancement beyond what indicators have today:
A strategy will likely use heterogeneus data, each with a different value scale. It would be useful to plot different time series on different subwindows, even if they all come from the same strategy class. For a simple example, plot an SMA on subwindow1, plot ATR on subwindow2, and plot #daysSinceLastMax on subwindow3. 
Each one requires a different y axis scale to represent it properly. And all these indicators really belong to the strategy, so the strategy should be able to control how and where they are plotted.
This can be done in the AddPlot() method. 
Thanks for your interest :)

user-offline.png  MultiCharts Support
Oct 01, 2013 - 15:42

Unfortunately addition of "plot" keywrod support in signal is an intesive task and it also may lead to mupltile complications due to current realization of chart structure, so another solution is suggested:
1. In the signal instead of plot the new keyword will be used: i_setplotvalue****(int seria_number, double value).
2. Additional indicator will required for plotting, but instead of transferring and adopting the whole logic of the signal to an indicator, the other keyword is used: i_getplotvalue****(int seria_number).
So the script of the indicator to realize the plot calculated in signal would be: plot1(i_getplotvalue(1), 'BuyEntryLevel ' ); 

user-offline.png  MultiCharts Support
Oct 02, 2013 - 09:30

Unfortunately as i said previously, the implementation of "plot" in signals requires significant changes in the software and possibly leads to further difficulties. So far the described scheme will be implemented.

user-offline.png  MultiCharts Support
Jan 02, 2014 - 09:39

Well, nothing is wrong if you are using MC 8.8, because the feature is scheduled for MC 9.0 that is not yet released.

user-offline.png  SB-FO
Jul 09, 2024 - 12:44

All, this can be done. See: https://hightick.com/plotting-directly-from-within-strategies-with-tlplotfast/

Issue basics
  • Type of issue
    Feature request
  • Category
  • Targeted for
    MultiCharts 9.0 (RELEASED)
  • Status
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (3)
People involved
  • Posted by
    user-offline.png  Xyzzy
  • Owned by
    Not owned by anyone
  • Assigned to
    Not assigned to anyone
  • Subscribers
    6 subscriber(s)
    Click here to show the list of subscribers
Times and dates
  • Posted at
  • Last updated
Issue details
  • Resolution
    Not determined
  • Severity
Commits (0)
There are no code checkins for this issue

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.