V# VARIABLES AND BACKTESTING

Login or Register

Please login or register in order to view and post in the Forum.

6 posts / 0 new
Last post
adrianfaiers
Last seen: 6 years 11 months ago
Joined: 10/10/2013 - 00:00
V# VARIABLES AND BACKTESTING

This question is in 2 parts.

I have a custom indicator which compares the ON range with the day session range.

When the current ON range is set, the customer indicator plots all the Day session HLR, when the ON range falls between the a set parameter. I set this via c#1 and c#2 on buttons. Basically I add deduct 20% from todays ON range and add 20% to todays overnight range.

The indicator then plots the day session ranges on the following

signal =true*sesst

Signal being the ON HLR between c#1 and c#2
Sesst being the hlr of the day session.
I then take the average of these hlr ranges and plot from the current day session extremes to give me possible hi and lows for the session.
I want to then test this in the PSA for validity afterwards.

First question

Currently at the moment I enter the range via buttons setting the c#1 and c#2
I would like to automated this.
So the signal being ON HLR between (ON HLR*0.8) and (ON HLR*1.20)
But when I try that, it always use the ON HLR of each day back. So it is always true. Every ON HLR is always between 80 and 120 percent.
So how do I code it so that it compares only to current ON HLR when looking back.

Do I have the signal as ON HLR between C#1 and C#2?

with C#1 being set by Customer Indicator 1 being ON HLR * 0.8
with C#2 being set by Customer Indicator 2 being ON HLR * 1.20

This seems to work. But this draws all past levels at the same distance.
Which makes sense as C#1 and C#2 are fixed.
So it always filters the day session by the same amount thus getting the same figures.

Second question

If I want to test the edge in fading these levels using the PSA. It is no good, all the levels being based on the todays between values.

So how do I approach it, so that the levels are plotted using that days ON range between 0.8 and 1.2 and filter the past day sessions for this amount and the getting the average of these past day session HLR.

I would attach a definition but IRT force closed when I was finishing this, and deleted the indicators and charts. Twice even though I saved before hand. The only indicator that it id not delete was the indicator which caused the crash, but trying to open it or export to send to you just caused it to crash again.

Before I start writing the indicators again, it would be a good to get some feedback on how to approach this.

Thanks in advance.

Adey

0
mobelby
Last seen: 7 years 2 hours ago
Joined: 11/07/2015 - 20:39
I'd be interested in this too

I'd be interested in this too as I am trying to automate a lot of my analysis.
I only discvovered the HLR token a while ago.
If there is another way of doing this that is more reliable I'd appreciate knowing

cpayne
Last seen: 1 year 7 months ago
Joined: 03/30/2009 - 00:00
Day and Overnight Analysis

I'm not completely clear what you are looking for here, so I'm going to start by creating this chart that shows.

  • Overnight High and Low (red lines)...using Session Statistics
  • Day Session High and Low plus a % of the day range (controlled by C#1 button at top)  (blue lines)....using a Custom Indicator that in turn uses Session Statistics.
  • Paint Bars paints the overnight period in light gray.

So using this as a visual, let me know where you want to go from here (screenshots welcomed).

adrianfaiers
Last seen: 6 years 11 months ago
Joined: 10/10/2013 - 00:00
DAY HLR FILTER BY ONR

Hi

I have attached your chart but updated. I am using daily bars and have not wrapped the indicators inside a MPD, just to save time. In the future I would

A The chart first checks what the ONR range was for today.

B The chart then checks back at all ONR that are between C#2 and C#3. This range is the current ONR minus 20% and plus 20%. If the ONR in the past is between c#2 and c#3 then it prints the day session range.

C This is a 100 MA of the filtered day session ranges.

https://www.screencast.com/t/QqrrRdRw5e

https://www.linnsoft.com/charts/dayovernightadey-esh7

I then deduct this from the day session hi to get the average low when the ONR is of a certain size.

Okay so everything is fine so far.

My questions where

1. I want to automated these lines so I do not to put in c#2 and c#3 by hand. How best do I go about? Using the filter that the past ONR fall between current ONR plus/minus 20%
2. I would like to test these lines in the Pivot Strategy Analyser. But the problems is hi and low in the past is draw using the current days filter range C#2 and C#3. So histroically day would need to draw its high and low lines on that days ONR.

I hope this has made it clearer.

Thanks in advance.

Adey

cpayne
Last seen: 1 year 7 months ago
Joined: 03/30/2009 - 00:00
Store Current Value into C#2/C#3

Adey,

First (and I think you're already aware), the way you've applied Session Statistics directly to the daily bars without wrapping them in a 15m or 30m MPD, is not giving you accurate numbers...when you have it setup for ON or Day Session.  Right now, it's always giving you the full session high, low, range, whatever.   But anyway, I think you know that.

So all you need to do is add an indictor that computes ONH + 20% and ONL - 20%.  And add those to you chart.  In the settings for each CI, choose to "Record Current Value into C#2/C#3" respectively.  So that will initialize C#2 and C#3 properly and your other indicators/statistics will run with that.  Let me know how that goes.

adrianfaiers
Last seen: 6 years 11 months ago
Joined: 10/10/2013 - 00:00
Hi Chad,

Hi Chad,

Thanks. That seems to work. Just got to go back and check that the numbers come out okay. But at first glance it all seems good.

Thanks again.

Adey