List of new and not supported reserved words

Questions about MultiCharts and user contributed studies.
User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

List of new and not supported reserved words

Postby Andrew Kirillov » 21 Feb 2007

THE LIST OF NEW POWERLANGUAGE RESERVED WORDS

Drawings: Arrows

NumericSimple arw_new(NumericSimple sdate, NumericSimple stime, NumericSimple svalue, BoolSimple LDir) [of Data*] // - creates a new arrow on a data stream (symbol) and returns its ID. If the data stream is not set explicitly, the arrow will be set on that data series which the study is based on.
LDir: TRUE – Down Arrow; FALSE – Up Arrow.
NumericSimple arw_delete(NumericSimple ref) // - deletes an arrow by its ID
NumericSimple arw_getactive // - returns ID of an active arrow
NumericSimple arw_getcolor(NumericSimple ref) // - returns an arrow color by ID
NumericSimple arw_getdate(NumericSimple ref) // - returns an arrow date by ID
NumericSimple arw_gettime(NumericSimple ref) // - returns an arrow time by ID
NumericSimple arw_getval(NumericSimple ref) // - returns an arrow price by ID
NumericSimple arw_getfirst(NumericSimple type) // - returns ID of the first arrow by its type (the same is used in tl_getfirst())
NumericSimple arw_getnext(NumericSimple arr_ref,NumericSimple type) // - returns ID of the next arrow by ID of the previous arrow and by the type (the same is used in tl_getnext()).
BoolSimple arw_getdirection(NumericSimple ref) // - returns an arrow direction (vertical orientation) by ID. TRUE – Down Arrow; FALSE – Up Arrow.
NumericSimple arw_getstyle(NumericSimple ref) // - returns an arrow style(type)by ID.
NumericSimple arw_getsize(NumericSimple ref) // - returns an arrow size(width)by ID.
NumericSimple arw_setcolor(NumericSimple ref, NumericSimple color) // - sets an arrow color by ID.
NumericSimple arw_setlocation(NumericSimple ref, NumericSimple date, NumericSimple time, NumericSimple value) // - sets an arrow location by ID.
NumericSimple arw_setstyle(NumericSimple ref, NumericSimple lVal) // - sets an arrow style by ID.
NumericSimple arw_setsize (NumericSimple ref, NumericSimple lVal) // - sets an arrow size by ID.
StringSimplearw_gettext(NumericSimple ref) // returns a text string associated with the arrow by ID.
NumericSimple arw_settextcolor(NumericSimple ref, NumericSimple color) // sets a text string color associated with the arrow by ID.
NumericSimple arw_gettextcolor(NumericSimple ref) // returns a text string color associated with the arrow by ID.
NumericSimple arw_gettextbgcolor(NumericSimple ref) // returns a text string background color associated with the arrow by ID.
NumericSimple arw_settextbgcolor(NumericSimple ref, NumericSimple _color) // sets a text string background color associated with the arrow by ID.
NumericSimple arw_new_s(NumericSimple sdate, NumericSimple stime, NumericSimple svalue, BoolSimple lDir) [of Data*] // - same as arw_new, but time-params values are expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple arw_gettime_s(NumericSimple ref) // - same as arw_gettime, but a returning value is in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple arw_setlocation_s(NumericSimple ref, NumericSimple date, NumericSimple time, NumericSimple value) // - same as arw_setlocation, but time-params values are expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).


Drawings: Text

NumericSimple text_getbgcolor(NumericSimple ref) // returns a background color to the text string of a text-drawing by ID.
NumericSimple text_setbgcolor(NumericSimple ref, NumericSimple color) // sets a background color to the text string of a text-drawing by ID.
NumericSimple text_setsize(NumericSimple ref, NumericSimple lSize) // sets a text size of a text-drawing by ID.
NumericSimple text_getsize(NumericSimple ref) // returns a text size of a text-drawing by ID.
NumericSimple text_setborder(NumericSimple ref, TrueFalseSimple bFrame) // shows the border of a text-drawing by ID if the second param is TRUE and hides its border if it is FALSE.
TrueFalseSimple text_getborder(NumericSimple ref) // returns TRUE value if the border is visible and FALSE if it is hidden.
NumericSimple text_new_s(NumericSimple date, NumericSimple time, NumericSimple price, StringSimple ) // - same as text_new, but time-params values are expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple text_setlocation_s(NumericSimple ref, NumericSimple date, NumericSimple time, NumericSimple price) // - same as text_setlocation, but time-param value is expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple text_gettime_s(NumericSimple ref) // - same as text_gettime, but a returning value is in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).


Drawings: TrendLine

NumericSimple tl_new_s(NumericSimple sdate, NumericSimple stime, NumericSimple svalue, NumericSimple edate, NumericSimple etime, NumericSimple evalue) // - same as tl_new_s, but time-params values are expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple tl_setbegin_s(NumericSimple ref, NumericSimple date, NumericSimple time, NumericSimple value) // - same as tl_setbegin_s, but time-param value is expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple tl_setend_s(NumericSimple ref, NumericSimple date, NumericSimple time, NumericSimple value) // - same as tl_setend, but time-param value is expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple tl_getbegintime_s(NumericSimple ref) // - same as tl_getbegintime, but a returning value is in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple tl_getendtime_s(NumericSimple ref) // - same as tl_getendtime, but a returning value is in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).
NumericSimple tl_getvalue_s(NumericSimple ref, NumericSimple date, NumericSimple time) // - same as tl_getvalue, but time-param value is expected in time-seconds format ("151232" – 15 hours, 12 minuts and 32 seconds).

P.S. Undeclarated return codes of arw_set***-functions are the same as tl_set*** or text_set***

Drawing object functions return the following values if the function fails:
Value Explanation
-2 The object identifier was invalid
-3 The data number (Data2, Data3, and so on) passed to the function was invalid.
-4 The value passed to a SET function was invalid.
-5 The beginning and ending points were the same.
-6 The function was unable to load the default values for the tool.
-7 Unable to add object. Possibly due to out of memory condition.
-8 Invalid pointer.
-9 Previous failure.
-10 Too many trendline objects on the chart.
-11 Too many text objects on the chart.


Time: Seconds

time_s – same as "time" easy language keyword, but returns time in EL-time format with seconds (ELTFS) (i.e. for example 123456 – 12:34:56 pm). of Data (of Data(N)) and bars back reference ([N], of bars ago, etc.) operators can be applied to it;

Example:
time_s[1] of Data2; - returns time in HHMMSS format of the previous bar of the second data stream.

NumericSimple eltimetodatetime_s(NumericSimple time) – converts time in ELTFS to system DateTime;
NumericSimple time2time_s(NumericSimple eltime) - converts EL time in ELTFS time;
NumericSimple time_s2time(NumericSimple ELTFStime) - converts ELTFS time to EL time;
NumericSimple lastcalcsstime() [of Data(N)] - returns time in a number of seconds since midnight for the last completed bar.
NumericSimple datetime2eltime(NumericSimple julian_format_datetime) - converts from Julian DateTime to EL time;
NumericSimple datetime2eltime_s(NumericSimple julian_format_datetime) - converts from Julian DateTime to ELTFS time;

Time: Some additional user functions

- SecondsToTime // - converts seconds to EL – time format.
- SecondsToTime_s // - converts seconds to ELTFS – time format.
- LastCalcTime_s // - returns the time of completion (Close) of the last bar, in ELTFS – time format.
- LastBarOnChart_s // - returns TRUE if this bar is last completed bar, otherwise returns FALSE. You need to use this function instead of TS LastBarOnChart one to correctly detect the last completed bar during the calculation on symbols with the seconds-resolution type.
- TimeToSeconds // - converts EL – time to seconds
- CalcTime_s // - same as CalcTime but accepts time in ELTFS – time format in the first param and incremental/decremental value in seconds.


Drawings: Text (additional formats)

Attributes' meanings and values:

Attribute Explanation
type
0 True – text drawing has the border.
1 True – text drawing has the bold text format.
2 True – text drawing has the italic text format.
3 True – text drawing has the strikeout text format.
4 True – text drawing has the underline text format.

Attributes can be combined.
Example:
value1=text_new(d,t,c,"Some Text"); // we have original "Some Text" text
text_setattribute(value1,1,true); // returns bold text "Some Text"
text_setattribute(value1,2,true); // returns bold italic text "Some Text"

NumericSimple text_setattribute(NumericSimple ref, NumericSimple _attr_type, BoolSimple _val) – sets the value (third parameter) of a corresponding attribute (second parameter) for a text drawing with ID (first parameter).
BoolSimple text_getattribute(NumericSimple ref, NumericSimple _attr_type) – returns the value of a corresponding attribute(second parameter) for a text drawing with ID (first parameter).
NumericSimple text_setfontname(NumericSimple ref, StringSimple _name) – sets a font by the name for a text drawing with ID (first parameter).
StringSimple text_getfontname(NumericSimple ref) – returns a font by the name for a text drawing with ID (first parameter).
NumericSimple arw_settextattribute(NumericSimple ref, NumericSimple _attr_type, BoolSimple _val) – sets the value (third parameter) of a corresponding text attribute (second parameter)for an arrow drawing with ID (first parameter).
BoolSimple arw_gettextattribute(NumericSimple ref, NumericSimple _attr_type) – returns the value of a corresponding attribute(second parameter) for an arrow drawing with ID (first parameter).
NumericSimple arw_settextfontname(NumericSimple ref, StringSimple _name) – sets a text font by the name for an arrow drawing with ID (first parameter).
StringSimple arw_gettextfontname(NumericSimple ref) – returns a text font by the name for an arrow drawing with ID (first parameter).
NumericSimple arw_settextsize(NumericSimple ref, NumericSimple _val) – sets a text size for an arrow drawing with ID (first parameter).
NumericSimple arw_gettextsize(NumericSimple ref) – returns a text size for an arrow drawing with ID (first parameter).

tl_new_self_s,
tl_new_self,
text_new_self,
text_new_self_s,
arw_new_self,
arw_new_self_s,

- mimic the ordinal drawing functions, except for the fact that they are applied to an indicator (indicator plots will determine "base series" for these drawings).


Resolution: Info

NumericSimple bartype_ex [of Data(*)] – returns MC adaptable symbol resolution info:
Tick = 1, // Tick
Volume = 8,
Second = 9,
Minute = 2,
Hour = 3,
Day = 4,
Week = 5,
Month = 6,
Year = 7,
Quarter = 10,
Points = 11,
Change = 12,
OrigPoints = 13,


Others

size_t basedatanumber() – number of the base series which the study is applied to
size_t currentdatanumber() – number of the current series
void recalculate() – recalculates the study from the very beginning (1 bar)

marketposition_checked
maxpositionprofit_checked
maxpositionloss_checked
positionprofit_checked
contractprofit_checked
barssinceentry_checked
barssinceexit_checked
entrydate_checked
entrytime_checked
entryprice_checked
exitdate_checked
exittime_checked
exitprice_checked
maxcontractprofit_checked
maxcontracts_checked
maxentries_checked
maxshares_checked
- these key words function in the same way as the similar ones without "_checked" postfix. The difference is that they check the "position ago" parameter and generate "Max position ago" error if the check has failed (if we don't have enough positions – maxpositionago < "position ago" parameter value).

NumericSimple maxpositionago() – returns the maximum number of avaliable positions.
Note. This word is not available in the release version. It will be available later.


barstatus - returns bar status for the current data-stream. It was modified and it can be called without parameters (i.e. data stream number shouldn't be explicitly indicated) now.

sessionlastbar - returns True if a given bar is the latest in the series. Can use of Data(***).
Example: if sessionlastbar then // action on last bar in session.
Last edited by Andrew Kirillov on 11 Feb 2008, edited 9 times in total.

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 21 Feb 2007

THE LIST OF RESERVED WORDS WHICH ARE CURRENTLY NOT SUPPORTED

ab_addcell
ab_averageprice
ab_cellcount
ab_getnumcells
ab_high
ab_low
ab_rowheight
atcommentarybar
avgbarseventrade
avgbarslostrade
avgbarswintrade
avgentryprice
callopenint
callvolume
checkcommentary
cleardebug
commentary
commentarycl
commentaryenabled
commoditynumber
contractprofit
contractprofit_checked
dailytradesdn
dailytradesup
dailyvolumedn
dailyvolumeuc
dailyvolumeup
deliverymonth
deliveryyear
grossloss
grossprofit
high52wk
i_avgentryprice
i_closedequity
i_currentcontracts
i_currentshares
i_marketposition
i_openequity
insideask
insidebid
ivolatility
largestlostrade
largestwintrade
leftside
low52wk
margin
maxconseclosers
maxconsecwinners
maxcontractprofit
maxcontractprofit_checked
maxcontractsheld
maxiddrawdown
maxpositionloss
maxpositionloss_checked
maxpositionprofit
maxpositionprofit_checked
maxsharesheld
numeventrades
numlostrades
numwintrades
percentprofit
putopenint
putvolume
q_callopenint
q_downvolume
q_tradevolume
q_unchangedvolume
q_upvolume
rightside
setbreakeven
setdollartrailing
setexitonclose
setpercenttrailing
setplottype
slippage
symbolroot
totalbarsevemtrade
totalbarslostrade
totalbarswintrade
totaltrades
tradevolume
unionsess1endtime
unionsess1starttime
unionsess2endtime
unionsess2starttime
Last edited by Stanley Miller on 22 Feb 2007, edited 1 time in total.

Guest

Postby Guest » 22 Feb 2007

pls add commentary soon.

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 26 Feb 2007

We are not going to support this feature in the nearest future.

Guest

Postby Guest » 27 Feb 2007

can you make a list of words that will not be supported?

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

Postby TJ » 09 Mar 2007

We are not going to support this feature in the nearest future.
is there any reason why Commentary is not supported?

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 11 Mar 2007

Dear TJ,
is there any reason why Commentary is not supported?
Because we are not going to support "Analysis Commentary window" functionality.

Guest

Postby Guest » 12 Mar 2007

Dear TJ,
is there any reason why Commentary is not supported?
Because we are not going to support "Analysis Commentary window" functionality.
Why ?

Did your users feedback that this function is not useful ?

I find it useful.

Guest

Postby Guest » 13 Mar 2007

why is it in the PL editor?

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 14 Mar 2007

Dear Sir,
why is it in the PL editor?
It is added in PLEditor as "ignored" word just to support smooth studies compilation. Actually it is ignored.

Guest

Postby Guest » 17 Mar 2007

Dear Sir,
why is it in the PL editor?
It is added in PLEditor as "ignored" word just to support smooth studies compilation. Actually it is ignored.
commentary is one of the ways to debug a program. What other ways do you use to spit out the variables during operation?

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

These are commonly used things. when they will be supported?

Postby 2haerim » 21 Mar 2007

- avgentryprice
- contractprofit
- grossloss
- grossprofit
- maxcontractprofit
- maxpositionloss
- maxpositionprofit
- setbreakeven
- setdollartrailing
- setexitonclose
- setpercenttrailing

In addition, the following two are also needed
- I_MarketPosition
- I_CurrentContracts

Could you tell me if these are in development and if so when these are to be supported?

haerim

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

Postby TJ » 23 Mar 2007

We are not going to support this feature in the nearest future.
can we have a schedule of what is to be supported, and items that are NEVER going to be supported?

e.g. what words that are currently NOT supported, but on your to-do list?
what time frame we are looking at? what is going to be supported in 3 months? what is going to be supported in 6 months?

what is NEVER going to be supported? (or at least not in the next 12 months)


as MC is getting to become more sophisticated, the users will be building more enabling programs. We do need to know the capabilities of MC, both now and in the scheduled future, so that we can plan our programs accordingly.

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 28 Mar 2007

To guest:
commentary is one of the ways to debug a program. What other ways do you use to spit out the variables during operation?

Code: Select all

print();

To 2haerim:
All these words will be added this year.


To TJ:
I think you understand we are trying to support as much words as possible. At the moment we are concentrated on product's stability so I can provide with a more specific ETA regarding your question.

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

Postby TJ » 29 Mar 2007

To TJ:At the moment we are concentrated on product's stability so I can provide with a more specific ETA regarding your question.At the moment we are concentrated on product's stability so I can provide with a more specific ETA regarding your question.
Fair enough. pls concentrate on the stability issues.

p.s. I am one of the lucky ones. My MC has been running days on end, and it is solid as a rock. I have a 3 yrs old notebook (2GB), I run 2 instances with a total of 12 wsp, with Jerry's indicators and loads of my own. I also run xls on DDE, Quotetracker, Firefox, Brackettrader, etc. Never have a problem with stability.

p.s. the drawing tools do give me problem sometimes, but I understand you have that fixed in the next release.

p.s. I do want to see you support "commentary" in the future.

Guest

Text and TrendLine attributes

Postby Guest » 10 Jul 2007

Hi,

Would it be possible to add 2 attritubes to both text and Trendlines to provide;

1. Transparency - % able to be specified
2. Ability to Move to back so TL's in particular draw behind Text/Indicators/Price

Thankyou

Guest

Postby Guest » 01 Aug 2007

Is it because certain words are not supported the reason so many third party TS ELD's I've tried will not compile without errors in MultiCharts? I've wondered why this was.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 15 Aug 2007

Is it because certain words are not supported the reason so many third party TS ELD's I've tried will not compile without errors in MultiCharts? I've wondered why this was.
Yes, that might be the reason.

Guest

Postby Guest » 21 Aug 2007

Is it because certain words are not supported the reason so many third party TS ELD's I've tried will not compile without errors in MultiCharts? I've wondered why this was.
Yes, that might be the reason.

Here is one ELD that works in TS8.2 but compiles with multiple errors in MC. Can one of the EL genius's take a peek at this and see why it doesn't complile and what the fix might entail?

Thank you.

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


inputs:

iStartDate(1060120), // if not intraday, date to start counting

iPrice( Close ),
iDecimals(2),
iPeriods(5),
// iHigh( HighD(0) ),
// iLow( LowD(0) ),

iFibPlot("R"), // "P" = projections, "R" = retracements
//iFib1(.24),
//iFib2(.38),
iFib3(.50),
//iFib4(.62),
//iFib5(.76),
//iFib1Color(darkcyan ),
//iFib2Color(darkbrown),
iFib3Color(darkgray),
//iFib4Color(darkbrown ),
//iFib5Color(darkcyan ),
HighColor( red),
LowColor( blue),

idummy("");

variables:

//xFib1(iFib1),
//xFib2(iFib2),
xFib3(iFib3),
//xFib4(iFib4),
//xFib5(iFib5),

tFib(""),

xLowestLow(0),
xHighestHigh(0),
xRange(0),

xPosition(0),

oExtremeVal( 0 ),
oExtremeBar( 0 ) ;


variables:

xBars( 0 ),
xPeriods(05),
xOldPeriods(0),

Dynamic_R( 0 ),
Dynamic_S( 0 ),
OldDynamic_R( 0 ),
OldDynamic_S( 0 ),
PrevDynamic_R( 0 ),
PrevDynamic_S( 0 ) ;


{commentary variables}
variables:
xcomm(0),
oComm1( "" ),
oComm2( "" ),
oComm3( "" ),
oComm4( "" ),
oComm5( "" ),
oComm6( "" ),
oComm7( "" ),
oComm8( "" ),
oComm9( "" ),
oComm10( "" );


{ CALCULATIONS }




If date this bar >= iStartDate
then begin

{save old values}

If Dynamic_R <> PrevDynamic_R
then OldDynamic_R = PrevDynamic_R;

If Dynamic_S <> PrevDynamic_S
then OldDynamic_S = PrevDynamic_S ;

OldDynamic_R = PrevDynamic_R ;
OldDynamic_S = PrevDynamic_S ;

PrevDynamic_R = Dynamic_R ;
PrevDynamic_S = Dynamic_S ;



{ high / low for period }



xBars = xBars + 1;




oExtremeVal = Extremes( L, iPeriods, -1, Dynamic_S , oExtremeBar ) ; // lowest low

oExtremeVal = Extremes( H, iPeriods, 1, Dynamic_R , oExtremeBar ) ; // highest high



If Dynamic_R <> H
and Dynamic_R < PrevDynamic_R
then if PrevDynamic_R <> 0
then Dynamic_R = PrevDynamic_R;

If Dynamic_S <> L
and Dynamic_S > PrevDynamic_S
then if PrevDynamic_S <> 0
then Dynamic_S = PrevDynamic_S;

{
If iLow <> iLow[1]
Or iHigh <> iHigh[1]
then begin
}
If iFibPlot = "R"
Or iFibPlot = "r"
then begin


xLowestLow = Dynamic_S ;

xRange = Dynamic_R - Dynamic_S ;

//xFib1 = iFib1 * xRange + xLowestLow;
//xFib2 = iFib2 * xRange + xLowestLow;
xFib3 = iFib3 * xRange + xLowestLow;
//xFib4 = iFib4 * xRange + xLowestLow;
//xFib5 = iFib5 * xRange + xLowestLow;
end // If iFibPlot = "R"...
else Begin

// oExtremeVal = Extremes( iLow[iPeriods], iPeriods, -1, xLowestLow , oExtremeBar ) ; // lowest low

// oExtremeVal = Extremes( iHigh[iPeriods], iPeriods, 1, xHighestHigh , oExtremeBar ) ; // highest high

xLowestLow = Dynamic_S ;

xHighestHigh = Dynamic_R ;

xRange = xHighestHigh - xLowestLow;

If close > OpenD(0)
then begin
//xFib1 = iFib1 * xRange + xHighestHigh; // high projections
//xFib2 = iFib2 * xRange + xHighestHigh;
xFib3 = iFib3 * xRange + xHighestHigh;
//xFib4 = iFib4 * xRange + xHighestHigh;
//xFib5 = iFib5 * xRange + xHighestHigh;
end
else begin
//xFib1 = xLowestLow - iFib1 * xRange ; // low projections
//xFib2 = xLowestLow - iFib2 * xRange ;
xFib3 = xLowestLow - iFib3 * xRange ;
//xFib4 = xLowestLow - iFib4 * xRange ;
//xFib5 = xLowestLow - iFib5 * xRange ;
end;

end;

// end; { If iLow <> iLow[1]... }



//Plot1(xFib1 , "fib1", iFib1Color ) ;

//Plot2(xFib2 , "fib2", iFib2Color ) ;

Plot3(xFib3 , "fib3", iFib3Color ) ;


//Plot4(xFib4 , "fib4", iFib4Color ) ;


//Plot5(xFib5 , "fib5", iFib5Color ) ;



Plot6(Dynamic_R , "Resistance", HighColor ) ;

Plot7(Dynamic_S , "Support", LowColor ) ;


end; // If date >= xStartDate


CommentaryCl( "Dynamic_R: ", NumToStr( Dynamic_R , iDecimals) );

CommentaryCl( "Dynamic_S: ", NumToStr( Dynamic_S , iDecimals) );


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

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 21 Aug 2007

Hello,

I just checked your indicator and it compiled without errors.

What MC version are you using btw?

Guest

Postby Guest » 21 Aug 2007

Hello,

I just checked your indicator and it compiled without errors.

What MC version are you using btw?

Oops, I posted the wrong one.

Try this one:





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


inputs:

iAlert(false),
iStartDate(1070101), // if not intraday, date to start counting
iPlotFibs(true),
iPlotSR(true),
iPlotTrade(false),
iPrice( Close ),
iDecimals(2),
iPeriods(5),
// iHigh( HighD(0) ),
// iLow( LowD(0) ),

iFibPlot("R"), // "P" = projections, "R" = retracements
iFib1(.24),
iFib2(.38),
iFib3(.50),
iFib4(.62),
iFib5(.76),
iFib1Color(darkcyan ),
iFib2Color(darkbrown),
iFib3Color(darkgray),
iFib4Color(darkbrown ),
iFib5Color(darkcyan ),
HighColor( red),
LowColor( blue),

idummy("");

variables:

fg8(white),
bg8(black),


xAppType(0),
sFirstPass(true),

tInd(""),
tAlert(""),

xFib1(iFib1),
xFib2(iFib2),
xFib3(iFib3),
xFib4(iFib4),
xFib5(iFib5),

tFib(""),

xLowestLow(0),
xHighestHigh(0),
xRange(0),

xPosition(0),

oExtremeVal( 0 ),
oExtremeBar( 0 ) ;


variables:

xBars( 0 ),
xPeriods(05),
xOldPeriods(0),

Dynamic_R( 0 ),
Dynamic_S( 0 ),
OldDynamic_R( 0 ),
OldDynamic_S( 0 ),
PrevDynamic_R( 0 ),
PrevDynamic_S( 0 ) ;


{commentary variables}
variables:
xcomm(0),
oComm1( "" ),
oComm2( "" ),
oComm3( "" ),
oComm4( "" ),
oComm5( "" ),
oComm6( "" ),
oComm7( "" ),
oComm8( "" ),
oComm9( "" ),
oComm10( "" );



{first time through}

if sFirstPass
then begin

sFirstPass = false;


{ APP TYPE TEST }

sFirstPass = false;

xAppType = GetAppInfo(aiApplicationType); // cUnknown = 0 cChart = 1 cRadarScreen = 2 cOptionStation = 3


end; {if sFirstPass}


{ INITIALIZE }


tInd = "";
tAlert = "";


{ CALCULATIONS }




If date this bar >= iStartDate
then begin

{save old values}

If Dynamic_R <> PrevDynamic_R
then OldDynamic_R = PrevDynamic_R;

If Dynamic_S <> PrevDynamic_S
then OldDynamic_S = PrevDynamic_S ;

OldDynamic_R = PrevDynamic_R ;
OldDynamic_S = PrevDynamic_S ;

PrevDynamic_R = Dynamic_R ;
PrevDynamic_S = Dynamic_S ;



{ high / low for period }



xBars = xBars + 1;




oExtremeVal = Extremes( L, iPeriods, -1, Dynamic_S , oExtremeBar ) ; // lowest low

oExtremeVal = Extremes( H, iPeriods, 1, Dynamic_R , oExtremeBar ) ; // highest high



If Dynamic_R <> H
and Dynamic_R < PrevDynamic_R
then if PrevDynamic_R <> 0
then Dynamic_R = PrevDynamic_R;

If Dynamic_S <> L
and Dynamic_S > PrevDynamic_S
then if PrevDynamic_S <> 0
then Dynamic_S = PrevDynamic_S;

{
If iLow <> iLow[1]
Or iHigh <> iHigh[1]
then begin
}
If iFibPlot = "R"
Or iFibPlot = "r"
then begin


xLowestLow = Dynamic_S ;

xRange = Dynamic_R - Dynamic_S ;

xFib1 = iFib1 * xRange + xLowestLow;
xFib2 = iFib2 * xRange + xLowestLow;
xFib3 = iFib3 * xRange + xLowestLow;
xFib4 = iFib4 * xRange + xLowestLow;
xFib5 = iFib5 * xRange + xLowestLow;
end // If iFibPlot = "R"...
else Begin

// oExtremeVal = Extremes( iLow[iPeriods], iPeriods, -1, xLowestLow , oExtremeBar ) ; // lowest low

// oExtremeVal = Extremes( iHigh[iPeriods], iPeriods, 1, xHighestHigh , oExtremeBar ) ; // highest high

xLowestLow = Dynamic_S ;

xHighestHigh = Dynamic_R ;

xRange = xHighestHigh - xLowestLow;

If close > OpenD(0)
then begin
xFib1 = iFib1 * xRange + xHighestHigh; // high projections
xFib2 = iFib2 * xRange + xHighestHigh;
xFib3 = iFib3 * xRange + xHighestHigh;
xFib4 = iFib4 * xRange + xHighestHigh;
xFib5 = iFib5 * xRange + xHighestHigh;
end
else begin
xFib1 = xLowestLow - iFib1 * xRange ; // low projections
xFib2 = xLowestLow - iFib2 * xRange ;
xFib3 = xLowestLow - iFib3 * xRange ;
xFib4 = xLowestLow - iFib4 * xRange ;
xFib5 = xLowestLow - iFib5 * xRange ;
end;

end;

// end; { If iLow <> iLow[1]... }



{ Alert criteria }

If high >= Dynamic_R
then begin
Fg8 = red;
Bg8 = white;
tAlert = "Price touched Resistance" ;
end
else
If Low <= Dynamic_S
then begin
Fg8 = blue;
Bg8 = white;
tAlert = "Price touched Support" ;
end;



{ Alert }

if iAlert
and tAlert <> ""
//and tAlert <> tAlert[1]
then Alert( tAlert ) ;


if iPlotFibs
then begin

Plot1(xFib1 , "fib1", iFib1Color ) ;

Plot2(xFib2 , "fib2", iFib2Color ) ;

Plot3(xFib3 , "fib3", iFib3Color ) ;

Plot4(xFib4 , "fib4", iFib4Color ) ;

Plot5(xFib5 , "fib5", iFib5Color ) ;

end; // iPlotFibs

if iPlotSR
then begin

Plot6(Dynamic_R , "Resistance", HighColor ) ;

Plot7(Dynamic_S , "Support", LowColor ) ;

end; // iPlotSR

if iPlotTrade
then begin
if Low[1] = Dynamic_S
and Close[1] > Low[1]
then Plot9 (Dynamic_S , "go long", white ) ;

if High[1] = Dynamic_R
and Close[1] < High[1]
then Plot10 (Dynamic_R , "go short", white ) ;
end ; // iPlotTrade

end; // If date >= xStartDate





if xAppType = 2
then begin

if close = xFib1
then SetPlotBGColor( 1, white );

if close = xFib2
then SetPlotBGColor( 2, white );

if close = xFib3
then SetPlotBGColor( 3, white );

if close = xFib4
then SetPlotBGColor( 4, white );

if close = xFib5
then SetPlotBGColor( 5, white );

if close = Dynamic_R
then SetPlotBGColor( 6, white );

if close = Dynamic_S
then SetPlotBGColor( 7, white );

Plot8(tAlert , "Alert", yellow ) ;
end;

CommentaryCl( "Dynamic_R: ", NumToStr( Dynamic_R , iDecimals) );

CommentaryCl( "Dynamic_S: ", NumToStr( Dynamic_S , iDecimals) );

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 22 Aug 2007

Hello,

Attached, please see the corrected code.
The problem with it was that MC unlike TS only supports 'Plot' as a numeric value, not as a string.
Attachments
testcode2.txt
(5.29 KiB) Downloaded 414 times

rsheftel
Posts: 17
Joined: 10 Mar 2006

Postby rsheftel » 11 Sep 2007

Is "currententries" supported? I do not see it on any of the lists in this topic, but it does not appear to work in PL.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 12 Sep 2007

What MC version are you using?

rsheftel
Posts: 17
Joined: 10 Mar 2006

Postby rsheftel » 12 Sep 2007

The beta 2.1

I see a newer beta on the download site, what has been added?

Also, I would make a suggestion:

If the compiler encounters a reserved word that is not available yet in MC, it should stop and throw an error message. To allow compilation is a bit deceptive and confuses the debugging. (if it does this already but it is just me in error I appologize)

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 12 Sep 2007

Hello,

There have been a lot of improvements in the latest beta: optimization speed has increased, as well as the speed of strategy calculations, numerous reserved words have been added for backtesting, lots of bugs fixed etc. The list of improvemements is quite long and will be posted once the new official 2.1 release is out.

As for you second comments, different unsupported words have different practical value. For example 'comments' is not supported, but an indicator containing this word would work just fine. It depends on a particular case.
So instead of stopping compilation in such cases we indicate that an indicator contains unsupported words with the red tick-mark.

User avatar
gautama2
Posts: 96
Joined: 10 Jul 2007
Has thanked: 1 time
Been thanked: 1 time

Postby gautama2 » 23 Sep 2007

So instead of stopping compilation in such cases we indicate that an indicator contains unsupported words with the red tick-mark.
This is basically okay, but signals containing setexitonclose i.e. are also reported as successfuly compiled but exit is not handled like that when applying the signal.

Simple example for demonatration:

Code: Select all

Inputs: n(9);

if c > Average(c, n) then buy("LE C-Avg") next bar at market;
if c < Average(c, n) then sellshort("SE C-Avg") next bar at market;

setexitonclose;
Attachments
tssmc01.png
(69.41 KiB) Downloaded 3538 times

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 24 Sep 2007

I'd like to express my opinion on this subject, as I find the current behavior very counterintuitive to the point of it preventing me from wanting to work on serious projects for MC that I would otherwise want to work on.

If the MC programmers feel that highlighting a word in red, leaving that word unimplemented, and then reporting a successful compile is the behavior they want, could that please be an option for their own use?

Then, for the rest of us who need to know if uncompilable/unimplemented code is present, and want a compilation failure in that case, could there be an option to fail the compile and report the reason(s) why?

While I would not venture to declare a change "trivial" to implement, I would tend to believe that out of the many challenges that the MC programmers have proven able to solve, this is would not be one of the tougher or more time consuming ones.

I know that I personally would find this to be a major improvement, and I suspect there are others who would agree. I'd appreciate if this could be considered at an early opportunity. Thanks!

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Postby aljafp » 24 Sep 2007

I am appalled by this....
What is the definition of a successful compliation ?

It should mean the piece of code should run in the system without any system level errors.....

If a piece of code cannot even run ... obviously compliation should fail !!!!!

I agree with the previous users... such implementation makes me feel uncomfortable.....

For such cases, please either fail compilation or have an output window that shows a WARNING for each of such lines

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 25 Sep 2007

Hello everybody,

Although your reasoning beyond asking us to leave codes with unsupported words uncompiled can be understood, we do not think this would be the optimal solution. The reasons are as follows:

1) As I mentioned before there are certain cases when with unsupported words the codes will still work fine when applied to a chart. On the other hand, implementing your idea would involve making these unfunctional.

2) Instead of simply failing compilation we have introduced three different status marks which show you what exactly the status of a given code is:

a. red means the functionality is not supported at all
b. yellow means that the code is partially unsupported
c. green means that the code is ready to work

We believe that this is a better solution then simply failing the compilation.

User avatar
gautama2
Posts: 96
Joined: 10 Jul 2007
Has thanked: 1 time
Been thanked: 1 time

Postby gautama2 » 25 Sep 2007

a. red means the functionality is not supported at all
b. yellow means that the code is partially unsupported
c. green means that the code is ready to work
Where can i see the colors?

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 25 Sep 2007

Hello,

When you run PLEditor, go to File and click Open. The window will be called showing the available indicators, signals, and functions. They will have tick marks showing the status of every study.

Regards.

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 25 Sep 2007

Thanks for replying.

My further comments are:
we do not think this would be the optimal solution.
Optimal for whom? I can tell you straightforwardly, the way it is now is terrible for me. No other development environment that I have ever worked with in the last two decades operates this way.
On the other hand, implementing your idea would involve making these unfunctional.
Perhaps this mis-statement is merely an artifact of trying to reply to more than one person at once. It does not apply at all to my proposal, in which I explicitly suggest leaving the current behavior available for those who might want it, while offering a new (and much more standard/typical/expected) behavior option for those who wish that instead.

If you, after further consideration, are unwilling to create this option, that's your right as the creators of the product, and a forthright statement of your intentions is always welcome and appropriate. If, however, you believe that such a decision actually helps your customers or partners, I think you are completely mistaken on this point.

User avatar
gautama2
Posts: 96
Joined: 10 Jul 2007
Has thanked: 1 time
Been thanked: 1 time

Postby gautama2 » 25 Sep 2007

Hello,

When you run PLEditor, go to File and click Open. The window will be called showing the available indicators, signals, and functions. They will have tick marks showing the status of every study.

Regards.
Thank you. But in my example mentioned above, i get green marks also for the formula that includes the setexitonclose word. But this word is not supported and so this formula is not ready to work.

Regards
Robert
Attachments
tssmc02.png
(70.95 KiB) Downloaded 3533 times

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Postby aljafp » 26 Sep 2007

Hello everybody,

Although your reasoning beyond asking us to leave codes with unsupported words uncompiled can be understood, we do not think this would be the optimal solution. The reasons are as follows:

1) As I mentioned before there are certain cases when with unsupported words the codes will still work fine when applied to a chart. On the other hand, implementing your idea would involve making these unfunctional.
Failing compilation would not make these unfunctional.
Let the compiler warn us which statements are not supported and we will simply comment them out.

I'd rather do this than to have compiled code not run.

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 26 Sep 2007

Failing compilation would not make these unfunctional.
Let the compiler warn us which statements are not supported and we will simply comment them out.

I'd rather do this than to have compiled code not run.
I agree completely with this.

rsheftel
Posts: 17
Joined: 10 Mar 2006

Postby rsheftel » 26 Sep 2007

I would agree that a prefered situation should be that only a compiling that is able to compile the entire code should return "success". If any word is not known or not able to be compiled because it is not implemented yet, then the compiler could simply return "word not implemented". Then the programmer can change the code to work. Any visual highlighting may get missed, and if the compiler tells me it is "success", then why would I check to the code to colors or tags?

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 27 Sep 2007

Hello everybody,

What you are saying makes a lot of sense.

We are going to change the compilation of codes containing upsupported words in future. This task has been added to our working schedule. As to impelentation ETA I cannot give you any details at the moment.

Regards.

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 28 Nov 2007

2 months have passed since the last message. Any update on when we might see the improvements discussed here?

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 17 Jan 2008

I would like to know if the improvements discussed here are going to be incorporated into the upcoming new release (Jan/Feb 2008).

It sure would be great to be able to access all the new capabilities from a PowerEditor that is straightforward and easy to use!

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 05 Feb 2008

So, does the new Beta build fail a compilation when an unsupported word is encountered?

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 13 Feb 2008

Hi. My recent question above seems to have been overlooked.
A simple statement of the current facts would be great.

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Postby SP » 14 Feb 2008

I would like to see "switch" and "case" as supported words as more and more TS codes use it instead of "if .. else".

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 14 Feb 2008

Hi. My recent question above seems to have been overlooked.
A simple statement of the current facts would be great.
Hi MC_Prog,

In the latest beta unsupported words are treated exactly the way they used to be. We agree that the current method creates a number of inconveniences. However as of now, we simply haven't had the time to change this.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 14 Feb 2008

Below, is a list of words that are not supported in the latest beta.

ab_addcell
ab_averageprice
ab_cellcount
ab_getnumcells
ab_high
ab_low
ab_rowheight
atcommentarybar
callopenint
callvolume
checkcommentary
commentary
commentarycl
commentaryenabled
commoditynumber
dailytradesdn
dailytradesup
dailyvolumedn
dailyvolumeuc
dailyvolumeup
deliverymonth
deliveryyear
high52wk
i_avgentryprice
i_closedequity
i_currentcontracts
i_currentshares
i_marketposition
i_openequity
ivolatility
leftside
low52wk
maxiddrawdown
putopenint
putvolume
q_callopenint
q_downvolume
q_tradevolume
q_unchangedvolume
q_upvolume
rightside
setplottype
symbolroot
tradevolume
unionsess1endtime
unionsess1starttime
unionsess2endtime
unionsess2starttime

deobisnath
Posts: 40
Joined: 17 Jul 2007

Postby deobisnath » 14 Feb 2008

Hi,

Is "from entry" supported?

thanks

Deo

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 15 Feb 2008

I'm answering the 3d time:) it is supported in MC 3.0 Beta.

deobisnath
Posts: 40
Joined: 17 Jul 2007

Postby deobisnath » 15 Feb 2008

Hi Andrew:

Sorry for the repeated questions but this is the first reply I saw, and was notified in my inbox.

So, is the beta version available? where can I download?

Thanks,

DEo

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 15 Feb 2008

See links on the forum or in Download section of the website.

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Postby MC_Prog » 15 Feb 2008

Marina,

Thanks for the current info, and for the list.

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 16 Feb 2008

BTW,
The latest Beta version has PowerLanguage Function reference (See help or PowerLanguage Editor). So you can always see what is supported and what is not there. We will add environment information (ai fucntions) in Beta 2. So EL-compatibility is pretty high now!


Return to “MultiCharts”