Parameters for Complex Chart Types from PL

Questions about MultiCharts and user contributed studies.
Joe@DA
Posts: 10
Joined: 09 Sep 2011
Has thanked: 6 times

Parameters for Complex Chart Types from PL

Postby Joe@DA » 18 Sep 2011

I use the ELCollections to pass data from one chart to another. For simple time-based charts I have identified the collection name with just symbol-bartype-barinterval type identifier. I want to make the code work with more complex chart types, e.g. Renko and Point-figure. From PL, how do I get to the parameters for these types (e.g. Box Size and Reversal on Point & Figure chart types)? In the code below, "MyName" would represent the collection name but it needs further qualification for more complex types.

Code: Select all

vars: MyName(" ");
once begin
ClearPrintLog;
print("Symbol = ", Symbol);
print("BarType = ", bartype);
print("BarType_ex = ", bartype_ex);
print("BarInterval = ", barinterval);
MyName = Symbol + "," + NumToStr(Bartype,0) + "," + NumToStr(Bartype_ex,0) + "," + NumToStr(BarInterval,0);
//need to add further qualifiers to MyName for Renko, PF etc
print("Name = ", MyName);
end;

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Parameters for Complex Chart Types from PL

Postby Dave Masalov » 19 Sep 2011

Joe@DA,

bartype_ex will return following values for complex chart types:

14 - Point & Figure
15 - Kagi
16 - Renko
17 - Line Break
18 - Heikin Ashi

Joe@DA
Posts: 10
Joined: 09 Sep 2011
Has thanked: 6 times

Re: Parameters for Complex Chart Types from PL

Postby Joe@DA » 19 Sep 2011

I'm already using bartype_ex. But that does not tell me the box size. I need that to differentiate between same chart types (e.g. Point/Figure) with different sizes.

See attached photo for the information I am interested in getting to from PL
Attachments
BoxSize.jpg
(16.11 KiB) Downloaded 311 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Parameters for Complex Chart Types from PL

Postby Henry MultiСharts » 20 Sep 2011

Boxsize
Returns the price-based interval setting associated with the specified price-based chart type an indicator or signal is applied to.
This value is set in the Chart Type section of the Settings tab within the Format Instrument dialog for a chart.

Chart Type Value Returned
Point & Figure Box Size value
Point Point value
Renko Box Size value

Revsize
Returns the Reversal of a Point & Figure chart, the Reversalof a Kagi chart, or the number of Line Breaks in a Line Break chart. This value is set in the Chart Type section of the Settings tab within the Format Instrument dialog for a chart.
Example
RevSize returns 2 if the reversal size of a P & F chart is set to 2.
RevSize returns 5 if the number of line breaks for a Line Break chart is set to 5.
RevSize returns 4 if the reversal size of a Kagi chart is set to 4%.
New PowerLanguage keywords

Joe@DA
Posts: 10
Joined: 09 Sep 2011
Has thanked: 6 times

Re: Parameters for Complex Chart Types from PL

Postby Joe@DA » 21 Sep 2011

I've looked at BarType_ex for various chart types and find a difference between what is posted above and what the keyword returns. Can someone verify which is correct?
Posted Found
Renko 16 17
Line Break 17 16

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Parameters for Complex Chart Types from PL

Postby Henry MultiСharts » 21 Sep 2011

Your founding is correct.
Sorry for confusion.
BarType_ex returns:
17 for Renko
16 for Line Break

svfutures24
Posts: 16
Joined: 19 Dec 2023
Has thanked: 1 time

Re: Parameters for Complex Chart Types from PL

Postby svfutures24 » 13 Apr 2024

Thanks for the info above. What keywords are available for the FlexRenko charts? BarInterval works which reflects the "Resolution" but BoxSize returns 0. I also dont see anything for Reversal Offset or Trend Offset?

I am trying to figur eotu how i can use either ADE or ELCollections to transmit signals from a FlexRenko chart onto a 10 second chart. Thanks.

User avatar
BB123
Posts: 67
Joined: 24 Nov 2023
Has thanked: 22 times
Been thanked: 10 times

Re: Parameters for Complex Chart Types from PL

Postby BB123 » 13 Apr 2024

I am doing something similar-- and using Global Variables for this..


Set:
AccuracySetNamedInt("Current",Current);// this is for int values
AccuracySetNamedDouble("currentST",currentST );//double values

Get:
AccuracyGetNamedInt("Current",-1);
AccuracyGetNamedDouble"Current",-1);

So on chart 1 ill fun my functions and get a result.. if result = x then do y (set the gv),

On chart 2 -- if gv = x
then do Z. (place my trade).
reset GV back to NULL.
End;

svfutures24
Posts: 16
Joined: 19 Dec 2023
Has thanked: 1 time

Re: Parameters for Complex Chart Types from PL

Postby svfutures24 » 14 Apr 2024

I am doing something similar-- and using Global Variables for this..


Set:
AccuracySetNamedInt("Current",Current);// this is for int values
AccuracySetNamedDouble("currentST",currentST );//double values

Get:
AccuracyGetNamedInt("Current",-1);
AccuracyGetNamedDouble"Current",-1);

So on chart 1 ill fun my functions and get a result.. if result = x then do y (set the gv),

On chart 2 -- if gv = x
then do Z. (place my trade).
reset GV back to NULL.
End;

I could be totally mistaken but Global Variables are for real-time only right? For instance, If I use Global Variables for transmitting certain horizontal levels from time charts to flexrenko charts, they will not hold historical information. When I used ADE, it shown all historical data points too.

Let's say there was a signal to go long on FlexRenko chart window 1:

condition1 = long condition. //Flex Renko Chart window 1.

And I wanted to transmit this signal from FlexRenko Chart window 1 to a 10 second chart window 2 (not talking about multiple data series in one chart here)... Is this possible using Global Variables / ELCollections / something similar? The idea is to be able to back-test more accurately for non-time based charts.

I suppose I still come back to the question around keywords for FlexRenko charts.

Look forward to your reply.

User avatar
BB123
Posts: 67
Joined: 24 Nov 2023
Has thanked: 22 times
Been thanked: 10 times

Re: Parameters for Complex Chart Types from PL

Postby BB123 » 14 Apr 2024

I dont believe GV is only for rt.. If i back test-- and on chart 1 i get a buy signal-- put the var result into GV... Then on chart 2 it will see the GV and take a trade... I do use Global mode for playback... Im on mc14-- so in order to use Global Mode i have to close all my other charts to use playback(or they will all be trading whatever start i have on them all at the same time).. But that is ok..

I did just see someone else post in another thread talking about using Pmm keywords cause he thought it they were more stable then GV.. Ive never heard/used/tried or knew about pmm vars.. So maybe that is a better way to go.viewtopic.php?p=142240#p142120


But to answer your question -- i have been able to use GV for back testing(playback)..

svfutures24
Posts: 16
Joined: 19 Dec 2023
Has thanked: 1 time

Re: Parameters for Complex Chart Types from PL

Postby svfutures24 » 14 Apr 2024

I dont believe GV is only for rt.. If i back test-- and on chart 1 i get a buy signal-- put the var result into GV... Then on chart 2 it will see the GV and take a trade... I do use Global mode for playback... Im on mc14-- so in order to use Global Mode i have to close all my other charts to use playback(or they will all be trading whatever start i have on them all at the same time).. But that is ok..

I did just see someone else post in another thread talking about using Pmm keywords cause he thought it they were more stable then GV.. Ive never heard/used/tried or knew about pmm vars.. So maybe that is a better way to go.viewtopic.php?p=142240#p142120


But to answer your question -- i have been able to use GV for back testing(playback)..

Thank you for your reply. I'm relatively new to the use of these DLLs. I am trying to use the document to do so.

Here is a simple script I wrote to set the values:

Code: Select all

vars: bullishsig(0), bearishsig(0); // CONDITION1 and CONDITION2 are placeholders for example purposes if CONDITION1 = true then bullishsig = 1 else bullishsig = 0; if CONDITION2 = true then bearishsig = 1 else bearishsig = 0; if LastBarOnChart then begin getbullsig = GVSetNamedDouble("BullishFR",bullishsig); getbearsig = GVSetNamedDouble("BearishFR",bearishsig); end; plot1(bullishsig,"BULLSIG"); plot2(bearishsig,"BEARSIG");

This is an indicator applied to say the FlexRenko chart. On the subgraph I would be able to visually identify each time the signals are equal to 1 with a histogram plot.

Now, let's assume I have a 10-second chart on the same workspace but a different chart window. I then apply the below code to get the values:

Code: Select all

vars: bullishsig(0), bearishsig(0), getbullsig(0), getbearsig(0); bullishsig = GVGetNamedDouble("BullishFR",-1); bearishsig = GVGetNamedDouble("BearishFR",-1); plot1(bullishsig,"BULLS"); plot2(bearishsig,"BEARS");
My understanding is the output from chart1 will be taken and applied to chart2 subgraph. If that is the case, that would make sense how to transmsit the data from chart 1 (flexRenko) to chart 2 (time based).

However, when I attempt the above using a signal, and plot the indicator that get's the values into Chart 2, I get a 0.00 output. Is that because the getter function (GVGetNamedDouble) only works in real-time and will not show the signals from a historical stand point? For example, the signals that took place on Friday?

I hope my question is not overly complicated.

Example subgraph output from chart 1: FlexRenko:
Fig_Sig_Setter.png
(10.63 KiB) Not downloaded yet
Example subgraph output from Chart 2: 10 Second Chart:
Fig_Sig_Getter.png
(5.08 KiB) Not downloaded yet
Look forward to your reply.


Return to “MultiCharts”