Traders Tip's S&C Magazine PowerLanguage Code for Multicharts?

Questions about MultiCharts and user contributed studies.
User avatar
LRP
Posts: 153
Joined: 07 Apr 2008
Location: Switzerland
Has thanked: 96 times
Been thanked: 15 times

Traders Tip's S&C Magazine PowerLanguage Code for Multicharts?

Postby LRP » 10 Feb 2019

Dear Multicharts Support

May I ask kindly for providing to the MC-community the working PL-code for S&C Magazine issues?
Please see at: http://technical.traders.com/content/ba ... rchive.asp
Sometimes examples are written in the new EL Code which are not usable with PowerEditor for Multicharts.

Thank you very much,
LRP
Last edited by LRP on 10 Feb 2019, edited 4 times in total.

User avatar
LRP
Posts: 153
Joined: 07 Apr 2008
Location: Switzerland
Has thanked: 96 times
Been thanked: 15 times

Re: Traders Tip's S&C Magazine PowerLanguage Code for Multicharts?

Postby LRP » 10 Feb 2019

For Example 2019 March Issue:

Code: Select all

Indicator: SVE ZigZag Ticks
// SVE ZigZag Ticks
// TASC Mar 2019
// Sylvain Vervoort

using elsystem;
using elsystem.drawing;
using elsystem.drawingobjects;

inputs:
double HighPivotPrice( High ),
double LowPivotPrice( Low ),
double RetracePnts( 5 ),
int LineColor( Yellow ),
int LineWidth( 1 ) ;

variables:
intrabarpersist bool UseBNPoint( false ),
int DrawingObjectBarNumber( 0 ),
TrendLine ZigZagTrendline( NULL ),
DTPoint SwingDTPoint( NULL ),
DTPoint LastSwingDTPoint( NULL ),
BNPoint SwingBNPoint( NULL ),
BNPoint LastSwingBNPoint( NULL ),
double NewSwingPrice( 0 ),
double SwingPrice( Close ),
int TLDir( 0 ),
bool SaveSwing( false ),
bool AddTL( false ),
bool UpdateTL( false );

method TrendLine CreateNewTrendline()
variables: TrendLine tempTL;
begin
if UseBNPoint then
tempTL = TrendLine.Create(
LastSwingBNPoint, SwingBNPoint )
else { use DTPoint }
tempTL = TrendLine.Create(
LastSwingDTPoint, SwingDTPoint );

tempTL.Persist = false;
tempTL.Lock = true;
tempTL.Color = GetColorFromInteger(
255, LineColor );
tempTL.ExtLeft = false;
tempTL.ExtRight = false;
tempTL.Weight = LineWidth;
if DrawingObjects <> NULL then
DrawingObjects.Add( tempTL );
return tempTL;
end;

method Color GetColorFromInteger(
int Alpha, int ColorInteger )
begin
return Color.FromARGB(
Alpha, GetRValue( ColorInteger ),
GetGValue( ColorInteger ), GetBValue(
ColorInteger ) );
end;

once
begin
UseBNPoint = BarType = 0 or (
BarType > 4 and BarType <> 14 );

if UseBNPoint then
SwingBNPoint = BNPoint.Create(
CurrentBar + MaxBarsBack - 1, Close )
else
SwingDTPoint = DTPoint.Create(
BarDateTime, Close );
end;

if UseBNPoint then
DrawingObjectBarNumber =
CurrentBar + MaxBarsBack - 1;


NewSwingPrice = SwingHigh(
1, HighPivotPrice, 1, 2 );

if NewSwingPrice <> -1 then
begin
if TLDir <= 0 and NewSwingPrice >=
SwingPrice + RetracePnts then
begin
SaveSwing = true;
AddTL = true;
TLDir = 1;
end
else if TLDir = 1 and NewSwingPrice >=
SwingPrice then
begin
SaveSwing = true;
UpdateTL = true;
end;
end
else
begin
NewSwingPrice = SwingLow( 1,
LowPivotPrice, 1, 2 );
if NewSwingPrice <> -1 then
begin
if TLDir >= 0 and NewSwingPrice <=
SwingPrice - RetracePnts then
begin
SaveSwing = true;
AddTL = true;
TLDir = -1;
end
else if TLDir = -1 and NewSwingPrice <=
SwingPrice then
begin
SaveSwing = true;
UpdateTL = true;
end;
end;
end;

if SaveSwing then
begin
if UseBNPoint then
begin
LastSwingBNPoint = SwingBNPoint;
SwingBNPoint = BNPoint.Create(
DrawingObjectBarNumber[1],
NewSwingPrice );
end
else
begin
LastSwingDTPoint = SwingDTPoint;
SwingDTPoint = DTPoint.Create(
BarDateTime[1], NewSwingPrice );
end;
SwingPrice = NewSwingPrice;
SaveSwing = false;
end;

if AddTL then
begin
ZigZagTrendline = CreateNewTrendline();
AddTL = false;
end
else if UpdateTL then
begin
if ZigZagTrendline <> NULL then
begin
if UseBNPoint then
ZigZagTrendline.SetEndPoint(
SwingBNPoint )
else
ZigZagTrendline.SetEndPoint(
SwingDTPoint );
end;
UpdateTL = false;
end;

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

Re: Traders Tip's S&C Magazine PowerLanguage Code for Multicharts?

Postby TJ » 10 Feb 2019

For Example 2019 March Issue:
. . .
This is not basic EL codes.
They have the OOPL extension, which is only usable in TS v9+. The language is complex, it is for the advanced level programmers only.
Because of the difference in programming architecture, there is no easy way to make a simple and direct translation to the PL codes.

There are plenty of S&C codes available for MC. You need to look for codes written before TS v9. (IIRC it is about 2010).

User avatar
LRP
Posts: 153
Joined: 07 Apr 2008
Location: Switzerland
Has thanked: 96 times
Been thanked: 15 times

Re: Traders Tip's S&C Magazine PowerLanguage Code for Multicharts?

Postby LRP » 10 Feb 2019

For Example 2019 March Issue:
. . .
This is not basic EL codes.
They have the OOPL extension, which is only usable in TS v9+. The language is complex, it is for the advanced level programmers only.
Because of the difference in programming architecture, there is no easy way to make a simple and direct translation to the PL codes.
Of course, but it should be possible to make PL code available in Traders Tips from S&C Magazine or in our Multicharts-Forum. I'm sure this will be greatly appreciated by the grateful Multicharts users as it is offered by other widely used trading platforms. (see pic)
Attachments
Capture.PNG
(104.08 KiB) Downloaded 262 times


Return to “MultiCharts”