Ichimoku Cloud - Plot with Forward offset  [SOLVED]

Questions about MultiCharts and user contributed studies.
brunor
Posts: 58
Joined: 11 Feb 2013
Has thanked: 22 times
Been thanked: 5 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
Cloud.bmp (1.95 MiB) Viewed 393 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: 6584
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 970 times
Been thanked: 1907 times

Re: Ichioku Cloud - Plot with Forward offset

Postby TJ » 08 May 2017

brunor wrote: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) <--
These users thanked the author TJ for the post (total 2):
Angelina MultiСhartsbrunor

brunor
Posts: 58
Joined: 11 Feb 2013
Has thanked: 22 times
Been thanked: 5 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
Cloud.bmp (1.43 MiB) Viewed 377 times

User avatar
TJ
Posts: 6584
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 970 times
Been thanked: 1907 times

Re: Ichioku Cloud - Plot with Forward offset

Postby TJ » 08 May 2017

brunor wrote: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.
These users thanked the author TJ for the post:
brunor

User avatar
rrams
Posts: 34
Joined: 10 Feb 2011
Location: Arizona
Has thanked: 2 times
Been thanked: 16 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
Ichimoku.jpg (61.93 KiB) Viewed 367 times
Attachments
IckyMuMu.png
IckyMuMu.png (33.64 KiB) Viewed 367 times
Ichimoku.pla
(13.17 KiB) Downloaded 22 times
These users thanked the author rrams for the post:
brunor

User avatar
CrazyNasdaq
Posts: 262
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 77 times
Been thanked: 80 times

Re: Ichioku Cloud - Plot with Forward offset

Postby CrazyNasdaq » 09 May 2017

brunor wrote: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
These users thanked the author CrazyNasdaq for the post:
brunor

brunor
Posts: 58
Joined: 11 Feb 2013
Has thanked: 22 times
Been thanked: 5 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
These users thanked the author brunor for the post:
CrazyNasdaq


Return to “MultiCharts”