templates

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
User avatar
vsatrader
Posts: 18
Joined: 09 Jan 2007
Has thanked: 1 time

templates

Postby vsatrader » 29 Apr 2013

Hello coders.

I have a request,

I would like someone to post a paint-bar template so I can modify it to test out a theory please, and I would like to base it on price bars as in close > close -1 etc on up and down bars.

And cheeky I know, but another the same so I can add red and green dots underneath and on top up and down bars using price bars( Not paint-bars).

Any help would be gratefully appreciated.

Thank you in advance.

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

Re: templates

Postby TJ » 29 Apr 2013

Hello coders.

I have a request,

I would like someone to post a paint-bar template so I can modify it to test out a theory please, and I would like to base it on price bars as in close > close -1 etc on up and down bars.

And cheeky I know, but another the same so I can add red and green dots underneath and on top up and down bars using price bars( Not paint-bars).

Any help would be gratefully appreciated.

Thank you in advance.
This is too vague... there are so many permutations on what can be done. It is ok to ask people to do something, but you are likely to encounter more questions than answers, and you will be coming back to ask for more examples.

Have you given your idea a try?
Have you read the manuals?

I would suggest you post your efforts, then we can chime in to help you with debugging.

User avatar
vsatrader
Posts: 18
Joined: 09 Jan 2007
Has thanked: 1 time

Re: templates

Postby vsatrader » 29 Apr 2013

Hi TJ, and thanks for your reply, here is some code, I do not seem to be able to compile it.

MCFX paintbars

Inputs:
UpColor (red),
DnColor (green),
UnCngColor (yellow);

Variables:
BarColor (0);

If Close > Close[1] and Low > Low[1] and Close < High[1] and Close <= (High+Low)/2 then BarColor = UpColor //red
else
If Close[1] > Open[1] and Close < High[1] and Close > Close[1]then BarColor = UpColor //red
else
If Close > Open and Close <= (High+Low)/2 and Close[1] > Close[1] then BarColor = UpColor //red
else
If Close[1] < Open[1] AND Close > Close[1] AND Close < High[1] AND Low > Low[1]then BarColor = UpColor //red
else
If Close[1] > Open[1] AND High > High[1] AND High > High[2]AND Close < High[1] AND Close > Low[1]and Close < (High+Low)/2 then BarColor = UpColor //Red Hidden Upthrust
else
If Close < Close[1] and High < High[1] AND Close > Low[1]and Close >= (High+Low)/2 then BarColor = DnColor //green
else
If Close[1] < Open[1] and Close > low[1] and Close < Close[1]and High < High[1]then BarColor = DnColor //green
else
If Close < open and Close >= (High+Low)/2 then BarColor = DnColor //green
else
If Close[1] > Open[1] AND Close < Close[1] AND Close > Low[1]AND High < High[1] then BarColor = DnColor //green test inside bar
else
If Close[1] < Open[1] AND Low < Low[1] AND Close > Close[1] AND Close < High[1] AND Close <(H+L)/2 then BarColor = DnColor //Hidden Spring
else
BarColor = UnCngColor;

Plot1(High, "High", BarColor);
Plot2(Low, "Low", BarColor);
Plot3(Close, "Close", BarColor);


1Red: Close > Close[1] Low > Low[1] Close < High[1] and Close <= (High+Low)/2 //Up bar close middle

2Red: Close[1] > Open[1] and Close < High[1] and Close > Close[1] Stalling upside

3Red: Close > Open and Close <= (High+Low)/2 up bar close < midpoint

4Red: Close[1] < Open[1] AND Close > Close[1] AND Close < High[1] AND Low > Low[1] //down bar then 'no demand'




1Green: Close < Close[1] and High < High[1] AND Close > Low[1]and Close >= (High+Low)/2 //Down bar close middle

2Green: Close[1] < Open[1] and Close > low[1] and Close < Close[1]and High < High[1] and //Stalling downside

3Green: Close < open and Close >= (High+Low)/2

4Green: Close[1] > Open[1] AND Close < Close[1] AND Close > Low[1] AND High < High[1] // prev bar up, then test

---------------------------------------------------------

Close < Close[1]and High > High[1] //red

Close > Close[1]and Low < Low[1] //green
Attachments
TS Chart.jpg
(218.42 KiB) Downloaded 1296 times

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

Re: templates

Postby TJ » 29 Apr 2013

Hi TJ, and thanks for your reply, here is some code, I do not seem to be able to compile it.
...
I have compiled the code with no problem.

You must have included the non-codes into the indicator.
Please copy and paste (or screenshot) the error message here.
We cannot help you without the error message.

Where did you get the code?


please see How to post codes
viewtopic.php?f=16&t=11713

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

Re: templates

Postby TJ » 29 Apr 2013

here's the code you should be compiling, nothing more.

Code: Select all

Inputs:
UpColor (red),
DnColor (green),
UnCngColor (yellow);

Variables:
BarColor (0);

If Close > Close[1] and Low > Low[1] and Close < High[1] and Close <= (High+Low)/2
then BarColor = UpColor //red
else
If Close[1] > Open[1] and Close < High[1] and Close > Close[1]
then BarColor = UpColor //red
else
If Close > Open and Close <= (High+Low)/2 and Close[1] > Close[1]
then BarColor = UpColor //red
else
If Close[1] < Open[1] AND Close > Close[1] AND Close < High[1] AND Low > Low[1]
then BarColor = UpColor //red
else
If Close[1] > Open[1] AND High > High[1] AND High > High[2]AND Close < High[1] AND Close > Low[1]and Close < (High+Low)/2
then BarColor = UpColor //Red Hidden Upthrust
else
If Close < Close[1] and High < High[1] AND Close > Low[1]and Close >= (High+Low)/2
then BarColor = DnColor //green
else
If Close[1] < Open[1] and Close > low[1] and Close < Close[1]and High < High[1]
then BarColor = DnColor //green
else
If Close < open and Close >= (High+Low)/2 then BarColor = DnColor //green
else
If Close[1] > Open[1] AND Close < Close[1] AND Close > Low[1]AND High < High[1]
then BarColor = DnColor //green test inside bar
else
If Close[1] < Open[1] AND Low < Low[1] AND Close > Close[1] AND Close < High[1] AND Close <(H+L)/2
then BarColor = DnColor //Hidden Spring
else
BarColor = UnCngColor;

Plot1(High, "High", BarColor);
Plot2(Low, "Low", BarColor);
Plot3(Close, "Close", BarColor);

User avatar
vsatrader
Posts: 18
Joined: 09 Jan 2007
Has thanked: 1 time

Re: templates

Postby vsatrader » 29 Apr 2013

Hi TJ,

I have narrowed it down to this code:
Inputs:
UpColor (red),
DnColor (green),
UnCngColor (yellow);

Variables:
BarColor (0);

If High < High[1] and Low < Low[1]
then BarColor = UpColor //red
else
If High > High[1] and Low > Low[1]
then BarColor = DnColor //green
else
BarColor = UnCngColor;

Plot1(High, "High", BarColor);
Plot2(Low, "Low", BarColor);
Plot3(Close, "Close", BarColor);
Plot4(Open, "Open", BarColor);


The error code I get when trrying to compile it is this:

Study: "Seb 2" (Indicator)
Please wait ....
------ Compiled with error(s): ------
Compile error
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)


Thank you in advance

User avatar
vsatrader
Posts: 18
Joined: 09 Jan 2007
Has thanked: 1 time

Re: templates

Postby vsatrader » 29 Apr 2013

Hi TJ, and thanks for your reply, here is some code, I do not seem to be able to compile it.
...
I have compiled the code with no problem.

You must have included the non-codes into the indicator.
Please copy and paste (or screenshot) the error message here.
We cannot help you without the error message.

Where did you get the code?


please see How to post codes
viewtopic.php?f=16&t=11713
Can't remember, got it from a forum, maybe this one a few years back.
Regards S

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

Re: templates

Postby TJ » 29 Apr 2013

Hi TJ,

I have narrowed it down to this code:
Inputs:
UpColor (red),
DnColor (green),
UnCngColor (yellow);

Variables:
BarColor (0);

If High < High[1] and Low < Low[1]
then BarColor = UpColor //red
else
If High > High[1] and Low > Low[1]
then BarColor = DnColor //green
else
BarColor = UnCngColor;

Plot1(High, "High", BarColor);
Plot2(Low, "Low", BarColor);
Plot3(Close, "Close", BarColor);
Plot4(Open, "Open", BarColor);


The error code I get when trrying to compile it is this:

Study: "Seb 2" (Indicator)
Please wait ....
------ Compiled with error(s): ------
Compile error
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)


Thank you in advance


please see How to post codes
viewtopic.php?f=16&t=11713

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

Re: templates

Postby TJ » 29 Apr 2013

Hi TJ,

I have narrowed it down to this code:
...
The error code I get when trrying to compile it is this:

Study: "Seb 2" (Indicator)
Please wait ....
------ Compiled with error(s): ------
Compile error
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)


Thank you in advance
Please follow this guide
https://www.multicharts.com/trading-sof ... mnEnd_0%29


Return to “User Contributed Studies and Indicator Library”