Problem With Plotting from a Strategy to a Study  [SOLVED]

Questions about MultiCharts and user contributed studies.
wacketywidge
Posts: 22
Joined: 24 Oct 2013
Has thanked: 1 time
Been thanked: 1 time

Problem With Plotting from a Strategy to a Study

Postby wacketywidge » 22 Apr 2016

Trying to use i_GetPlotValue and i_SetPlotValue and NoPlot(x) to plot calculated stop values from a strategy using a study. Have used trend lines within the strategy successfully but this is certainly not a straight forward way to do it and is calculation intensive.

I want to have the plot "noplot" between trades. Have tried many different ideas, but none work. The study will plot calculated stop value, but will not "noplot" between trades.

Simple study code:

If i_GetPlotValue(216) = 1 then
Plot6(i_GetPlotValue(215),"6")
else
NoPlot(Plot6);

i_GetPlotValue(216) is Market Position and
i_GetPlotValue(215) is plotted stop

Appreciate help with this.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Problem With Plotting from a Strategy to a Study

Postby TJ » 22 Apr 2016

::

but will not "noplot" between trades.
Please go to Wiki and read the NOPLOT usage example.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Problem With Plotting from a Strategy to a Study

Postby TJ » 22 Apr 2016

ps.

Please see post #1 & #2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Problem With Plotting from a Strategy to a Study

Postby TJ » 22 Apr 2016

Trying to use i_GetPlotValue and i_SetPlotValue and NoPlot(x) to plot calculated stop values from a strategy using a study. Have used trend lines within the strategy successfully but this is certainly not a straight forward way to do it and is calculation intensive.

I want to have the plot "noplot" between trades. Have tried many different ideas, but none work. The study will plot calculated stop value, but will not "noplot" between trades.

Simple study code:

If i_GetPlotValue(216) = 1 then
Plot6(i_GetPlotValue(215),"6")
else
NoPlot(Plot6);

i_GetPlotValue(216) is Market Position and
i_GetPlotValue(215) is plotted stop

Appreciate help with this.
GIGO

Check the sending chart.

If the sending chart is sending "216" as "1",
then you will always have a plot.

wacketywidge
Posts: 22
Joined: 24 Oct 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Problem With Plotting from a Strategy to a Study

Postby wacketywidge » 22 Apr 2016

TJ
************
"Please go to Wiki and read the NOPLOT usage example."

I have done this.
*************
"Please see post #1 & #2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713"

I will be more careful about this. I don't ask for help very often, so not know all the protocals for doing this.
****************
"Check the sending chart.
If the sending chart is sending "216" as "1",
then you will always have a plot."

I have done this;--strategy values transfer to the study.
*****************

During the trade, it appears the chart plots correctly during the trade but then when the market position= 0, the plot continues to draw with the values kind of drifting up or down and the plot does not turn off.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Problem With Plotting from a Strategy to a Study

Postby TJ » 22 Apr 2016

TJ
****************
"Check the sending chart.
If the sending chart is sending "216" as "1",
then you will always have a plot."

I have done this;--strategy values transfer to the study.
Please show us what you have done.

How could you know the proper values are transferred? and received?

debug print out?

*****************

During the trade, it appears the chart plots correctly during the trade but then when the market position= 0, the plot continues to draw with the values kind of drifting up or down and the plot does not turn off.
Screen shot?

Where do you think is the problem?
-- the value?
or the plot/noplot?

wacketywidge
Posts: 22
Joined: 24 Oct 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Problem With Plotting from a Strategy to a Study

Postby wacketywidge » 22 Apr 2016

"Screen shot?

Where do you think is the problem?
-- the value?
or the plot/noplot?"

The problem is not with the values. I can get both values wanted from the strategy to the study; namely the marketposition and the value of the trailing stop. I can plot each of these in the study,so I know that part is working. The problem is with the plot/noplot.

I will try to get a screen shot to post.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Problem With Plotting from a Strategy to a Study

Postby TJ » 23 Apr 2016

"Screen shot?

Where do you think is the problem?
-- the value?
or the plot/noplot?"

The problem is not with the values. I can get both values wanted from the strategy to the study; namely the marketposition and the value of the trailing stop. I can plot each of these in the study,so I know that part is working. The problem is with the plot/noplot.

I will try to get a screen shot to post.
Read my post #2 again.

Read the wiki carefully, then compare the usage example to your syntax.

wacketywidge
Posts: 22
Joined: 24 Oct 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Problem With Plotting from a Strategy to a Study  [SOLVED]

Postby wacketywidge » 23 Apr 2016

OK---I found the problem. When plotting with the study and using NoPlot, I had the plot style type set to LINE. This then was plotting a line between the end of one trade and the beginning of the next trade when NoPlot was active. Changing the plot style type to point removed the connecting line. While I think NoPlot should stop the line when NoPlot is active, the point style display is an OK solution.

Thanks for the help


Return to “MultiCharts”