Sierra Chart  

Home | Download | Help/FAQ | Data/Trade Services
Software Documentation | Posting Information


Go Back   Sierra Chart > Sierra Chart Fast Response Support Board
Retrieve lost Username/Password
Register Search Today's Posts Mark Forums Read

How to Post a Message for Support

Reply
 
Thread Tools Search this Subtopic
  #1  
Old 11-02-2008, 05:41 AM
omni72's Avatar
omni72 omni72 is offline
Senior Member
 
Join Date: Jul 2008
Posts: 152
Default Wide Range study?

i found the Narrow Range study, but is there an equivalent Wide Range indicator? i've looked in the studies but don't see it listed under 'Wide Range' and didn't see anything else that looked similarly named.
__________________
thanks and take care -

derek
  #2  
Old 11-02-2008, 01:20 PM
SgtJ SgtJ is online now
Senior Member
 
Join Date: May 2007
Posts: 3,496
Default Re: Wide Range study?

Are you looking for outside bar?
__________________
The above commentary has been contributed by an SC user.
  #3  
Old 11-02-2008, 02:22 PM
omni72's Avatar
omni72 omni72 is offline
Senior Member
 
Join Date: Jul 2008
Posts: 152
Default Re: Wide Range study?

well, actually, i'm looking for the WR7 which is the opposite of the NR7. it's just the widest bar (which won't necessarily be an outside bar) in n bars, while the NR is the narrowest bar (which won't necessarily be an inside bar) in n bars. Ideally, i'd like to see a single study with NR/WR inputs.
__________________
thanks and take care -

derek
  #4  
Old 11-02-2008, 03:07 PM
SgtJ SgtJ is online now
Senior Member
 
Join Date: May 2007
Posts: 3,496
Default Re: Wide Range study?

ah, ok. Probably an easy study to create, though I'm not sure of the most efficient way.
__________________
The above commentary has been contributed by an SC user.
  #5  
Old 11-02-2008, 05:41 PM
omni72's Avatar
omni72 omni72 is offline
Senior Member
 
Join Date: Jul 2008
Posts: 152
Default Re: Wide Range study?

Quote:
Originally Posted by SgtJ View Post
ah, ok. Probably an easy study to create, though I'm not sure of the most efficient way.
right, and i'm guessing it could probably be cannibalized from something like Scottorama did for volume. i'm dinking around with the CPP file, since i have no coding experience at all i'm using stuff like duct tape, crayons, twine, paper clips, and silly string. i'm guessing it will end up looking kind of like this if i keep at it
__________________
thanks and take care -

derek
  #6  
Old 11-02-2008, 06:58 PM
SgtJ SgtJ is online now
Senior Member
 
Join Date: May 2007
Posts: 3,496
Default Re: Wide Range study?

lol, that's about the extent of my knowledge as well. I looked for the code for the NR study but didn't see it. That'll get you 90% of the way to WR. I'm sure it's easy to do, but to make it adjustable on the fly and not hardcode the lookback period would require a little effort for me.
__________________
The above commentary has been contributed by an SC user.

Last edited by SgtJ; 11-03-2008 at 02:10 AM.
  #7  
Old 11-03-2008, 01:19 AM
omni72's Avatar
omni72 omni72 is offline
Senior Member
 
Join Date: Jul 2008
Posts: 152
Default Re: Wide Range study?

thx for looking. agreed. i'm thinking with a little reverse engineering i might be able to mutate the Narrow Range study into a NR/WR custom. is the CPP code for the NR study available to SC users?
__________________
thanks and take care -

derek

Last edited by omni72; 11-03-2008 at 01:21 AM.
  #8  
Old 11-03-2008, 02:21 AM
SgtJ SgtJ is online now
Senior Member
 
Join Date: May 2007
Posts: 3,496
Default Re: Wide Range study?

Just thinking, you can always do something w/ the ATR study set to 1 period to generate your values.
__________________
The above commentary has been contributed by an SC user.
  #9  
Old 11-03-2008, 03:06 AM
SgtJ SgtJ is online now
Senior Member
 
Join Date: May 2007
Posts: 3,496
Default Re: Wide Range study?

I just put something together (hardcoded), WR7...though not sure how to prevent consecutive positives.

http://www.sierrachart.com/userimage...ploadImage.png
__________________
The above commentary has been contributed by an SC user.

Last edited by SgtJ; 11-03-2008 at 03:11 AM.
  #10  
Old 11-03-2008, 03:14 AM
omni72's Avatar
omni72 omni72 is offline
Senior Member
 
Join Date: Jul 2008
Posts: 152
Default Re: Wide Range study?

Quote:
Originally Posted by SgtJ View Post
Just thinking, you can always do something w/ the ATR study set to 1 period to generate your values.
while i appreciate your idea, i'm not sure i follow. even on a n=1 ATR it will consider:

The difference between the current high and the current low
The difference between the current high and the previous close
The difference between the current low and the previous close

in order to determine the 'true range'.

meanwhile, in a W/NR-n study it would just tell me which bars over the last n bars had the biggest and smallest ranges (using H/L only).

as always, thanks for your input.
__________________
thanks and take care -

derek
  #11  
Old 11-03-2008, 03:23 AM
SgtJ SgtJ is online now
Senior Member
 
Join Date: May 2007
Posts: 3,496
Default Re: Wide Range study?

This is crude, but may help

CPP Code:
SCSFExport scsf_WideRangeBar(SCStudyGraphRef sg)
{
    if (
sg.SetDefaults)
    {
        
        
sg.GraphName "Wide Range Bar";
        
sg.StudyDescription "Wide Range Bar";
        
sg.FreeDLL 0;

        
sg.DrawZeros 0;  // false
        
sg.GraphRegion 0;
        
        
sg.Subgraph[0].Name "WRB";
        
sg.Subgraph[0].DrawStyle DRAWSTYLE_COLORBAR;
        
sg.Subgraph[0].LineWidth 1;
        
sg.Subgraph[0].PrimaryColor RGB(255,128,0);
        
sg.AutoLoop 1;
        
        return;
    }
    
    
SCFloatArrayRef High sg.BaseDataIn[SC_HIGH];
    
SCFloatArrayRef Low sg.BaseDataIn[SC_LOW];
    
SCFloatArrayRef Out sg.Subgraph[0].Data;
    

        if ((
High[sg.Index]-Low[sg.Index])>(High[sg.Index 1]-Low[sg.Index 1])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index 2]-Low[sg.Index 2])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -3]-Low[sg.Index -3])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -4] - Low[sg.Index -4])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -5]-Low[sg.Index -5])&&(High[sg.Index] - Low[sg.Index])>(High[sg.Index -6] - Low[sg.Index -6])&&(High[sg.Index] - Low[sg.Index])>(High[sg.Index -7]-Low[sg.Index -7]))
            
Out[sg.Index] = High[sg.Index];
        else
            
Out[sg.Index] = 0;
    

__________________
The above commentary has been contributed by an SC user.
  #12  
Old 07-15-2010, 01:12 PM
gregorfx gregorfx is online now
Senior Member
 
Join Date: Jul 2008
Posts: 175
Default Re: Wide Range study?

Sierra,

is there a study for this by now? Widest bar from last x bars?

Thanks
  #13  
Old 07-15-2010, 05:31 PM
SC_SupportGroup's Avatar
SC_SupportGroup SC_SupportGroup is online now
Sierra Chart Support - Engineering Level
 
Join Date: Jan 2000
Posts: 34,596
Default Re: Wide Range study?

We do not think so. You will need to create this one if you require it.
__________________
Thank you, Cheers Mate, Danke, Merci, Gracias, Love
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy.
  #14  
Old 07-16-2010, 03:03 AM
gregorfx gregorfx is online now
Senior Member
 
Join Date: Jul 2008
Posts: 175
Default Re: Wide Range study?

thx
  #15  
Old 07-16-2010, 03:04 AM
gregorfx gregorfx is online now
Senior Member
 
Join Date: Jul 2008
Posts: 175
Default Re: Wide Range study?

Quote:
Originally Posted by SgtJ View Post
This is crude, but may help

CPP Code:
SCSFExport scsf_WideRangeBar(SCStudyGraphRef sg)
{
    if (
sg.SetDefaults)
    {
        
        
sg.GraphName "Wide Range Bar";
        
sg.StudyDescription "Wide Range Bar";
        
sg.FreeDLL 0;

        
sg.DrawZeros 0;  // false
        
sg.GraphRegion 0;
        
        
sg.Subgraph[0].Name "WRB";
        
sg.Subgraph[0].DrawStyle DRAWSTYLE_COLORBAR;
        
sg.Subgraph[0].LineWidth 1;
        
sg.Subgraph[0].PrimaryColor RGB(255,128,0);
        
sg.AutoLoop 1;
        
        return;
    }
    
    
SCFloatArrayRef High sg.BaseDataIn[SC_HIGH];
    
SCFloatArrayRef Low sg.BaseDataIn[SC_LOW];
    
SCFloatArrayRef Out sg.Subgraph[0].Data;
    

        if ((
High[sg.Index]-Low[sg.Index])>(High[sg.Index 1]-Low[sg.Index 1])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index 2]-Low[sg.Index 2])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -3]-Low[sg.Index -3])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -4] - Low[sg.Index -4])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -5]-Low[sg.Index -5])&&(High[sg.Index] - Low[sg.Index])>(High[sg.Index -6] - Low[sg.Index -6])&&(High[sg.Index] - Low[sg.Index])>(High[sg.Index -7]-Low[sg.Index -7]))
            
Out[sg.Index] = High[sg.Index];
        else
            
Out[sg.Index] = 0;
    

SgtJ, do you have a cpp file for this, I have troubles building this on my own.

thx
  #16  
Old 07-29-2010, 01:39 PM
gregorfx gregorfx is online now
Senior Member
 
Join Date: Jul 2008
Posts: 175
Default Re: Wide Range study?

Sierra team,

please help me with that code (that was created from sgtj above):

------
SCSFExport scsf_WideRangeBar(SCStudyGraphRef sg)
{
if (sg.SetDefaults)
{

sg.GraphName = "Wide Range Bar";
sg.StudyDescription = "Wide Range Bar";
sg.FreeDLL = 0;

sg.DrawZeros = 0; // false
sg.GraphRegion = 0;

sg.Subgraph[0].Name = "WRB";
sg.Subgraph[0].DrawStyle = DRAWSTYLE_COLORBAR;
sg.Subgraph[0].LineWidth = 1;
sg.Subgraph[0].PrimaryColor = RGB(255,128,0);
sg.AutoLoop = 1;

return;
}

SCFloatArrayRef High = sg.BaseDataIn[SC_HIGH];
SCFloatArrayRef Low = sg.BaseDataIn[SC_LOW];
SCFloatArrayRef Out = sg.Subgraph[0].Data;


if ((High[sg.Index]-Low[sg.Index])>(High[sg.Index - 1]-Low[sg.Index - 1])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index - 2]-Low[sg.Index - 2])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -3]-Low[sg.Index -3])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -4] - Low[sg.Index -4])&&(High[sg.Index]-Low[sg.Index])>(High[sg.Index -5]-Low[sg.Index -5])&&(High[sg.Index] - Low[sg.Index])>(High[sg.Index -6] - Low[sg.Index -6])&&(High[sg.Index] - Low[sg.Index])>(High[sg.Index -7]-Low[sg.Index -7]))
Out[sg.Index] = High[sg.Index];
else
Out[sg.Index] = 0;

}

----------

If I enter these into Wordpad and save it say as widestbar.cpp and try to build Advanced study DLL from SIerra, it doesn't work. I save the file in correct directory.

What must I do differently?

Thank you.
  #17  
Old 07-29-2010, 03:15 PM
nkhoi nkhoi is online now
Senior Member
 
Join Date: Jun 2007
Posts: 836
Default Re: Wide Range study?

if you look at the cpp sample studies.cpp you know that you need a header like this

Code:
/*****************************************************************************
	This is a C++ source code file.  This file contains example Advanced Custom
	Study functions.  It also contains functions for some built-in studies
	in Sierra Chart.
*****************************************************************************/

#include "sierrachart.h"

/****************************************************************************/

SCDLLName("Sierra Chart Custom Studies and Examples")

/*============================================================================
	This example code calculates a simple moving average (30 period by
	default).
----------------------------------------------------------------------------*/
// SCSFExport scsf_SimpMovAvg(SCStudyGraphRef sc)
so I guess you replace ("Sierra Chart Custom Studies and Examples") with ("WideRangeBar") then paste them in

Last edited by nkhoi; 07-29-2010 at 03:19 PM.
  #18  
Old 07-29-2010, 03:22 PM
gregorfx gregorfx is online now
Senior Member
 
Join Date: Jul 2008
Posts: 175
Default Re: Wide Range study?

thanks alot
  #19  
Old 07-29-2010, 05:37 PM
SC_SupportGroup's Avatar
SC_SupportGroup SC_SupportGroup is online now
Sierra Chart Support - Engineering Level
 
Join Date: Jan 2000
Posts: 34,596
Default Re: Wide Range study?

We will include this study in the next release as a user contributed study. You will be able to find it under:
Analysis >> Studies >> Add Custom Study >> Sierra Chart Custom Studies and Examples >> (name of study)
__________________
Thank you, Cheers Mate, Danke, Merci, Gracias, Love
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy.
  #20  
Old 07-30-2010, 06:41 AM
gregorfx gregorfx is online now
Senior Member
 
Join Date: Jul 2008
Posts: 175
Default Re: Wide Range study?

Quote:
Originally Posted by SC_SupportGroup View Post
We will include this study in the next release as a user contributed study. You will be able to find it under:
Analysis >> Studies >> Add Custom Study >> Sierra Chart Custom Studies and Examples >> (name of study)
great, thanks
Reply

Thread Tools Search this Subtopic
Search this Subtopic:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.