View Issue Details

IDProjectCategoryView StatusLast Update
0000042OverchartsTECHNICAL SUPPORTpublic2019-07-17 12:49
Reporterjonnytrade 
PriorityNORMALSeverityNORMALReproducibilityALWAYS
Status CLOSEDResolutionOPEN 
PlatformOverchartsOSWindowsOS Version7
Product Version5.4.5 
Target VersionFixed in Version 
Summary0000042: Can`t understand Sesion Statistic
DescriptionHello
Last two days I`m try to understand how work Sesion statistic in your platform, but can`t do it without your help.
In my example I want draw yesterday low/high. I`m use same preference for low and high. But with high no problem, low have problem and draw it wrong. What can be wrong?
In ideal situation I need:
- Yesterday low/high/close;
- Week low/high;
- Month low/high;
It possible?
Also please show where in preference I can mark for show my trades on chart? I can`t find it.

Best regards, Evgeny
  
TagsNo tags attached.
SectionINDICATORS

Activities

jonnytrade

2019-07-16 15:47

reporter  

Screen1.jpg (866,629 bytes)

NathanR

2019-07-16 16:54

manager   ~0000093

Evgeny,
try to write/compile and save a new indicator using the following code:

Pragma ("USE_REFERENCE_OBJECT_SCALE_AS_DEFAULT", true)

database DbDay("", "D", 1, "T")


dim YH as Numeric = 0
dim YL as Numeric = 0
dim YC as Numeric = 0
    
dim WH as Numeric = 0
dim WL as Numeric = 0
    
dim MH as Numeric = 0
dim ML as Numeric = 0

dim MemCurrentDay as Numeric = 0

Function Main()
    '<If you don't know what function to use, write 'MY' followed by a dot '.' => My. >
    
    dim CurrentDay as Numeric = dbexp(date, Dbday)
    
    if (MemCurrentDay <> CurrentDay) Then
        try
            YH = dbexp(high(-1), Dbday)
            YL = dbexp(low(-1), Dbday)
            YC = dbexp(close(-1), Dbday)
        Catch
        Endtry
        
        
        WH = dbexp(my.Analysistool.Maxex(high, "W"), Dbday)
        WL = dbexp(my.Analysistool.Minex(low, "W"), Dbday)
    
        MH = dbexp(my.Analysistool.Maxex(high, "M"), Dbday)
        ML = dbexp(my.Analysistool.Minex(low, "M"), Dbday)
        
        MemCurrentDay = CurrentDay
    Endif
    
    
    Return YH as YesterdayHigh, YL as YesterdayLow, YC as YesterdayClose, WH as WeekHigh, WL as WeekLow, MH as MonthHigh, ML as MonthLow
Endfunction

NathanR

2019-07-16 17:30

manager   ~0000094

...or if you'd like to use Statistic session indicator itself you have to set scaling format as same as reference object (chart)

jonnytrade

2019-07-17 07:37

reporter   ~0000095

Hello,
Thank you for answer, with new indicator now it work correct. I`m little bit understand programming and qestion for future (ex: I need previous week high/low) what I must change.
Also about my last qestion) I can`t find in preference where I can chouse a mark my trading orders on chart what I does yday.

Best regards, Evgeny

NathanR

2019-07-17 10:50

manager  

EV.png (23,410 bytes)
EV.png (23,410 bytes)

NathanR

2019-07-17 10:50

manager   ~0000096

Evgeny,
in order to view previous week high/low you have to set indicator style properties.
Specifically set to "Yes" draw indicator box on WEEKHIGH and on WEEKLOW as in the picture attached

To mark your trading orders simply use Filled Orders indicator. If you have chart trading activated, all orders will be displaced (see attached picture)

EV2.png (54,689 bytes)
EV2.png (54,689 bytes)
EV3.png (33,320 bytes)
EV3.png (33,320 bytes)

jonnytrade

2019-07-17 11:43

reporter  

Screen1-2.jpg (64,595 bytes)
Screen1-2.jpg (64,595 bytes)

jonnytrade

2019-07-17 11:43

reporter   ~0000097

Thank you for answer. With Fiilled orders I`m understand now it work. About week, we speak about different week)) About week high/low I understand. I mean last week, like on screen.

NathanR

2019-07-17 12:35

manager   ~0000098

Please try this modified version of the indicator. it plots ONLY previous yesterday H/L, prev Week H/L and prev Month H/L


Pragma ("USE_REFERENCE_OBJECT_SCALE_AS_DEFAULT", true)

database DbDay("", "D", 1, "T")
database DbWeek("", "W", 1, "T")
database DbMonth("", "M", 1, "T")

dim YH as Numeric = 0
dim YL as Numeric = 0
dim YC as Numeric = 0
    
dim YWH as Numeric = 0
dim YWL as Numeric = 0

dim YMH as Numeric = 0
dim YML as Numeric = 0


dim MemCurrentDay as Numeric = 0
dim MemCurrentWeek as Numeric = 0
dim MemCurrentMonth as Numeric = 0


Function Main()
    '<If you don't know what function to use, write 'MY' followed by a dot '.' => My. >
    
    dim CurrentDay as Numeric = dbexp(date, Dbday)
    dim CurrentWeek as Numeric = dbexp(date, Dbweek)
    dim CurrentMonth as Numeric = dbexp(date, Dbmonth)
    
    if (MemCurrentDay <> CurrentDay) Then
        try
            YH = dbexp(high(-1), Dbday)
            YL = dbexp(low(-1), Dbday)
            YC = dbexp(close(-1), Dbday)
        Catch
        Endtry
                
        MemCurrentDay = CurrentDay
               
    Endif
    
     
    if (MemCurrentWeek <> CurrentWeek) Then
        try
            YWH = dbexp(high(-1), Dbweek)
            YWL = dbexp(low(-1), Dbweek)
            
        Catch
        Endtry
                 
        
        MemCurrentWeek = CurrentWeek
               
    Endif
    
     if (MemCurrentMonth <> CurrentMonth) Then
        try
            YMH = dbexp(high(-1), Dbmonth)
            YML = dbexp(low(-1), Dbmonth)
            
        Catch
        Endtry
                 
        
        MemCurrentMonth = CurrentMonth
               
    Endif
    
    
    
    Return YH as YesterdayHigh, YL as YesterdayLow, YC as YesterdayClose, YWH as PrevWeekHigh, YWL as PrevWeekLow, YMH as PrevMonthHigh, YML as PrevMonthLow


Endfunction

jonnytrade

2019-07-17 12:46

reporter   ~0000099

Yes, it exactly what I need. Thank you very much.