Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 00:37:28 +0000



[User Discussion] - How do I Show Profiles on Subgraphs?

View Count: 7917

[2016-03-02 21:40:34]
enemyspy - Posts: 304
yes I will post the source code but I simply ask that if you make improvements to it via yourself or a 3rd party that you return the improved source code to me so that I can also benefit and learn from it. Have a couple more bugs to get out of it, and I will post a 3rd version with source code.
[2016-03-02 21:46:54]
enemyspy - Posts: 304
In the mean time here is a proper range histogram, so that you don't have to use the average daily range anymore.


#include "sierrachart.h"
SCDLLName("Range")
SCSFExport scsf_Range(SCStudyGraphRef sc)
{
  SCSubgraphRef Range = sc.Subgraph[0];
  SCInputRef StudyInput = sc.Input[0];
  if (sc.SetDefaults)
  {
    sc.GraphName = "Range";
    sc.FreeDLL = 0;
    sc.AutoLoop = 1;

    //  sc.UpdateAlways = 1;

    Range.Name = "Range";
    Range.DrawStyle = DRAWSTYLE_BAR;
    Range.PrimaryColor = RGB(144, 0, 144);

    return;
  }
  Range[sc.Index] = sc.High[sc.Index] - sc.Low[sc.Index];
  return;
}

[2016-03-03 00:00:45]
Yoda - Posts: 106
Thank you very much for the code to a proper range histogram. I have made a few minor modifications to the code and have enclosed it below. There is only one issue that I'm having when I add this study...SC is creating 2 subgraphs below the existing subgraphs. The first subgraph is blank, and then the range subgraph follows immediately below. Any idea why I'm getting the blank subgraph?



#include "sierrachart.h"
// See the following for more info: How do I Show Profiles on Subgraphs?
// Original created by enemyspy with a few subsequent modifications made by Yoda.
// This code is provided on an "As is, Where is" basis for educational purposes only.

SCDLLName("Range_v01b")
SCSFExport scsf_Range(SCStudyGraphRef sc)

{
SCSubgraphRef Range = sc.Subgraph[0];
SCInputRef StudyInput = sc.Input[0];
if (sc.SetDefaults)
{
sc.GraphName = "Range";
sc.FreeDLL = 0;
sc.AutoLoop = 1;
sc.ValueFormat = VALUEFORMAT_INHERITED; // Sets the numeric display format to the same format as set in Chart >> ChartSettings (Yoda)
sc.DisplayStudyInputValues = 0; // 0 to uncheck the Display Input Values box (Yoda)

// sc.UpdateAlways = 1;

Range.Name = "Range";
Range.DrawStyle = DRAWSTYLE_BAR;
Range.PrimaryColor = RGB(0, 255, 0); // Green (color changed by Yoda)
Range.LineWidth = 5; // The higher the #, the thicker the bar (Yoda)
Range.LineLabel = LL_DISPLAY_NAME | LL_NAME_REVERSE_COLORS | LL_NAME_ALIGN_CENTER | LL_NAME_ALIGN_FAR_RIGHT | LL_DISPLAY_VALUE | LL_VALUE_ALIGN_CENTER | LL_VALUE_ALIGN_VALUES_SCALE; // Automatically turns on the labels (Yoda)

return;
}
Range[sc.Index] = sc.High[sc.Index] - sc.Low[sc.Index];
return;

}


[2016-03-03 00:10:38]
Yoda - Posts: 106
@enemyspy - Your request to share improvements made to your source code is reasonable and certainly something that I would endeavor to do.
[2016-03-07 05:01:36]
enemyspy - Posts: 304
Hi Yoda,

This took a while, but I used some of your mods to that. Chose not to change the width and color as can be done in the subgraph display settings and saved.

I think you may have been getting the other chart region if you had the normal distribution study on there. It needs to be synced up to a study or and it's corresponding chart region or else it will make a blank.
[2016-03-07 05:41:29]
enemyspy - Posts: 304
Here is version 3 of the normal distribution curve. I have ironed out the bugs, but let me know if you uncover any more.

It works properly on pretty much anything now (at least I think).
Added a bunch more functionality, such as standard deviation settings, and a bunch of coloring settings. I have attached a picture with some examples, and the chartbook of that picture, to show how the settings are used in different ways. Feel free to download the chartbook with it and change the symbol to what you want.

I also added a swing rotation study (see details below).

There are some new settings to note to for the Normal distribution curve function:

1. Include 0 Values: If set to no it excludes all 0 values. This is for studies that skip bar indexes and have non 0 values in order to get accurate results. Such as the swing rotation study. On delta type studies it will cause inaccurate results if set to no. The default is yes.
2. Split STDevs between Highs and lows: It maybe useful to but this to yes for studies with positive and negative values that are some what gaussian. Such as cumulative delta.
3. % increment values: Sets the resolution of the histogram.
4. Remember to set the Chart Region to the same as the study you put it on.

This will likely be the last version Unless there is a tonne of demand for more advanced features I will consider working on a paid version for one time fee. But not likely as building it tables to view the data is time consuming, and other plots like investor RT would take way too much time.


Swing Rotation Study
- works as an auxiliary to the Zig Zag Study
-Set the Subgraph Input to "zig zag linelength" from the zig zag study.
-Configure the Zig Zag study "Addtional Output to spreadsheets" as yes to access the linelength subgraph.
-You can set it to show only positive only negative or combined lengths.
-You can also choose if you want to display the lengths as positive negative or split (for combined option).

-The Normal distribution curve study works well on this, ensure that Include 0 values is set to "no", and that you select the correct subgraph input for the data you are plotting.
Date Time Of Last Edit: 2016-03-07 05:45:09
imageexample.PNG / V - Attached On 2016-03-07 05:29:45 UTC - Size: 66.69 KB - 1072 views
attachmentDaily Range Stats.cht - Attached On 2016-03-07 05:30:33 UTC - Size: 103.9 KB - 628 views
attachmentDaily Statistics.dll - Attached On 2016-03-07 05:39:09 UTC - Size: 355 KB - 721 views
Attachment Deleted.
[2016-03-07 12:21:25]
User20450 - Posts: 330
umm u da man
[2016-03-07 12:46:09]
User20450 - Posts: 330
any reason i would get all kinds of errors when opening cht u posted ? windows erro code 126
[2016-03-07 13:12:48]
Halco - Posts: 92
Thanks again for this. I just want to be sure I understand what I'm seeing. The distribution curve is plotting ALL the subgraph data available on the chart, not just the data currently displayed?
[2016-03-07 13:19:23]
Yoda - Posts: 106
@User20450, for the chartbook to work, you need to copy both the 'Daily Range Stats.cht' and the 'Daily Statistics.dll' files to your data folder...i.e. into C:/SierraChart/Data (You cannot change the Daily Statistics.dll file name.

You will probably also have to change the Symbol to match that of your data provider: From the top Menu: Chart -> Chart Settings -> Main Settings -> Symbol
[2016-03-07 13:22:17]
User20450 - Posts: 330
yes im aware of that as thats what i did , and changed symbol ,. but no data shows up , below price
[2016-03-07 13:24:08]
Yoda - Posts: 106
@enemyspy, thank you for your work. I am very much looking forward to seeing the source code and how you created this study.
[2016-03-07 13:30:18]
Yoda - Posts: 106
@User20450. I'm not sure why it isn't working for you. Did you try it on the ES? If so, I have attached a screenshot to show what it looks like for me on a 1 m ES chart.
imageF.US.EPH16 [CBV] 1 Min #1 2016-03-07 08_26_47.192.png / V - Attached On 2016-03-07 13:28:14 UTC - Size: 114.56 KB - 913 views
[2016-03-07 13:45:50]
User15952 - Posts: 132
@Yoda

Reading between the lines, I would not hold my breath for the source code.

"This will likely be the last version Unless there is a tonne of demand for more advanced features I will consider working on a paid version for one time fee. But not likely as building it tables to view the data is time consuming, and other plots like investor RT would take way too much time."
[2016-03-07 21:56:20]
GiantAvocado - Posts: 67
Thanks for all your support folks; looks like Investor RT has the monopoly on this one though. I don't think SC has the base of traders who use this kind of stats generation for it to be profitable for them?
[2016-03-08 03:27:23]
enemyspy - Posts: 304
Halco wrote:
Thanks again for this. I just want to be sure I understand what I'm seeing. The distribution curve is plotting ALL the subgraph data available on the chart, not just the data currently displayed
?

It is referencing all data on the chart not just what is displayed.

any reason i would get all kinds of errors when opening cht u posted ? windows erro code 126

I have no idea. Make sure the DLL is in the right folder. (Data)
@enemyspy, thank you for your work. I am very much looking forward to seeing the source code and how you created this study.

Thanks for all your support folks; looks like Investor RT has the monopoly on this one though. I don't think SC has the base of traders who use this kind of stats generation for it to be profitable for them?

No problem. I do custom stats generation for myself and test trading systems off it, but it took me months to get it all working properly. To make it visually convenient, and universal to all applications would be a massive undertaking. I can honestly see why SC does not do it.



Frankly I would rather see them continue with the plans to store historical market depth data. That would be so much more useful for making actionable decisions in the now IMO.
Date Time Of Last Edit: 2016-03-08 03:34:36
[2016-03-08 03:38:48]
enemyspy - Posts: 304
also if you code stuff and do want to make it better let me know what you would like to do, and maybe we can keep passing it back and forth. I can get the code posted but it is pretty easy. Basically just uses s_Usetool members, a vector, and a couple of maps withe <iterator> library
[2016-03-09 13:09:37]
User20450 - Posts: 330
enemy where can i learn code like this ?
[2016-03-09 23:01:17]
enemyspy - Posts: 304
Well make no mistakes. I am both an amateur and a hack, and you should not listen to me. But if you want to learn acsil programming. I am not sure if OnnB is still active in the list of approved devs or not. but I took a 1 hour lesson from him which was productive. Then from there just youtube, and StackOverflow.com if you are stuck on something. Sierra Chart Engineering team has very helpful as well. Also check out the how tons for ascil and c++ on this site.

-A great c++ resource that helped me a lot for just basic concepts and my understanding is a Bucky's c++ tutorials series for beginners on youtube. You basically just have to keep trying to figure it out and eventually it will stop looking like a bunch gibberish. I have been at this for about a year now.
[2016-03-09 23:06:01]
enemyspy - Posts: 304
also if you go into the cpp source files in your sierra data folder, and start looking at some of the more simple indicators, recompile them yourself and alter them to see what your changes actually do it helps a lot.
[2016-03-09 23:41:16]
Yoda - Posts: 106
@enemyspy, thank you for working on this study. I accept your decision to keep the MarketStructureFunctions file private and very much appreciate the amount of code that you did share. If you ever do decide to release the file, please make a note in this thread as it will make further development of this study significantly easier.
[2016-04-03 12:02:37]
User20450 - Posts: 330
hey enemyspy , is there any way to get more defines profile , like per 10 or 100 , seems to be big for the area ? thanks
[2016-04-03 18:02:00]
enemyspy - Posts: 304
yes. You can make the resolution as high as you like. Use the setting % bar increment of range. The lower the setting the higher the resolution/the smaller the bar increment.

You can set it to as low as 0.01%. However due to certain limitations in the drawing tools, it is recommended that Lower resolutions (higher settings) are used for small data sets. If you do go for a higher resolution you can regain good definition in the profile by increasing the maximum length % of the bars.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account