Ichimoku Cloud - Plot with Forward offset  [SOLVED]

Questions about MultiCharts and user contributed studies.
brunor
Posts: 65
Joined: 11 Feb 2013
Has thanked: 24 times
Been thanked: 6 times

Ichimoku Cloud - Plot with Forward offset  [SOLVED]

Postby brunor » 08 May 2017

Found this code for the ichimoku Cloud on line ... it works fine but plots behind the leading price bar (see image).
Is it possible to offset the plot ahead of the leading price bar as it should be?
Thanks.
Cloud.bmp
(1.95 MiB) Downloaded 1311 times

Code: Select all

// Type: Indicator
// Name: Ichimoku - Cloud
{
Chart style:
Weight PlotName Style
Span1 Line Medium-thinnest
Span2 Line Medium-thinnest

Chart style:
PlotName Color
Span1 Cyan
Span2 Cyan
Scaling: Same as symbol.
}

Inputs:
Standard(26),
Turning(9),
Delayed(52);
Variables:
StdLine(0),
TurnLine(0),
Span1(0),
SPan2(0);

StdLine = (Highest(High, Standard) + Lowest(Low, Standard)) / 2;
TurnLine = (Highest(High, Turning) + Lowest(Low, Turning)) / 2;
Span1 = (StdLine + TurnLine) / 2;
Span2 = (Highest(High, Delayed) + Lowest(Low, Delayed)) / 2;

Plot1[Standard](Span1, "Span1");
Plot2[Standard](Span2, "Span2");

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

Re: Ichioku Cloud - Plot with Forward offset

Postby TJ » 08 May 2017

Found this code for the ichimoku Cloud on line ... it works fine but plots behind the leading price bar (see image).
Is it possible to offset the plot ahead of the leading price bar as it should be?
Thanks.
Cloud.bmp

Code: Select all

// Type: Indicator
// Name: Ichimoku - Cloud
{
Chart style:
Weight PlotName Style
Span1 Line Medium-thinnest
Span2 Line Medium-thinnest

Chart style:
PlotName Color
Span1 Cyan
Span2 Cyan
Scaling: Same as symbol.
}

Inputs:
Standard(26),
Turning(9),
Delayed(52);
Variables:
StdLine(0),
TurnLine(0),
Span1(0),
SPan2(0);

StdLine = (Highest(High, Standard) + Lowest(Low, Standard)) / 2;
TurnLine = (Highest(High, Turning) + Lowest(Low, Turning)) / 2;
Span1 = (StdLine + TurnLine) / 2;
Span2 = (Highest(High, Delayed) + Lowest(Low, Delayed)) / 2;

Plot1[Standard](Span1, "Span1");
Plot2[Standard](Span2, "Span2");

You can adjust the offset by changing the Inputs: Standard(26) <--

brunor
Posts: 65
Joined: 11 Feb 2013
Has thanked: 24 times
Been thanked: 6 times

Re: Ichioku Cloud - Plot with Forward offset

Postby brunor » 08 May 2017

Appreciate the response TJ. I would like to plot the indicator ahead of the current bar. Altering the inputs changes the calculations.
Is it possible to offset the entire plot forward as seen in this image.
Thank You.
Bruno
Cloud.bmp
(1.43 MiB) Downloaded 1295 times

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

Re: Ichioku Cloud - Plot with Forward offset

Postby TJ » 08 May 2017

Appreciate the response TJ. I would like to plot the indicator ahead of the current bar. Altering the inputs changes the calculations.
Is it possible to offset the entire plot forward as seen in this image.
Thank You.
Bruno

Cloud.bmp

You can use a negative number to shift the plot forward.

User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

Re: Ichioku Cloud - Plot with Forward offset

Postby rrams » 08 May 2017

You have to format the window Chart Shift 26 bars.
Ichimoku.jpg
(61.93 KiB) Downloaded 1285 times
Attachments
IckyMuMu.png
(33.64 KiB) Downloaded 1285 times
Ichimoku.pla
(13.17 KiB) Downloaded 602 times

User avatar
CrazyNasdaq
Posts: 319
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Ichioku Cloud - Plot with Forward offset

Postby CrazyNasdaq » 09 May 2017

Appreciate the response TJ. I would like to plot the indicator ahead of the current bar. Altering the inputs changes the calculations.
Is it possible to offset the entire plot forward as seen in this image.
Thank You.
Bruno

Cloud.bmp
Try this way

Code: Select all

Inputs:
Standard(26),
Turning(9),
Delayed(52);
Variables:
StdLine(0),
TurnLine(0),
Span1(0),
SPan2(0),
color(0);

StdLine = (Highest(High, Standard) + Lowest(Low, Standard)) / 2;
TurnLine = (Highest(High, Turning) + Lowest(Low, Turning)) / 2;
Span1 = (StdLine + TurnLine) / 2;
Span2 = (Highest(High, Delayed) + Lowest(Low, Delayed)) / 2;

if Span2 > Span1 then color = red;
if Span2 < SPan1 then color = blue;

Plot1[-1*Standard](Span1, "Span1");
Plot2[-1*Standard](Span2, "Span2");
Plot3[-1*standard](span1, "Span1 ",color);
plot4[-1*Standard](Span2, "Span2 ", color);
Then set theese setting in CHART Style
Image



Set in Format Window a chart shift of more bars then your "STandard" input parameter (more then 26 by default)
Image


And You obtain this ICHIMOKU chart
Image

brunor
Posts: 65
Joined: 11 Feb 2013
Has thanked: 24 times
Been thanked: 6 times

Re: Ichioku Cloud - Plot with Forward offset

Postby brunor » 09 May 2017

Thank you all for your assistance. As all of you indicated, it was a simple matter of increasing the chart shift.
And thanks to CrazyNasdaq for the enhanced code ... I will use it.

Bruno


Return to “MultiCharts”