Custom price and RSI script
Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=432
Printed Date: 24 Apr 2025 at 12:50am Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com
Topic: Custom price and RSI script
Posted By: JackNader
Subject: Custom price and RSI script
Date Posted: 06 Aug 2007 at 8:15am
This script replaces the most current bar's closing price with a custom price. The purpose is to probe price vs turning point of the RSI.
[horzline=50]
P := input("Price",0,0); X := if ( barnumber = lastvalue(barnumber), p, c);
U := ma(max( x - hist(c,1),0),14,wilders); D := ma(max( hist(c,1) - x,0),14,wilders);
rs := 100 - (100/(1 + (U/D)));
[color=rgb(225,128,0)] rs;
My problem is that I need the script to include the current closing price as well so that I can calculate the expected price turning point in advance of market open. I tried using the ref function to solve the issue
X := if ( barnumber = lastvalue(barnumber), p, ref(c,1) ); y := if ( barnumber = lastvalue(barnumber), c, c );
U := ma(max( x - y,0),14,wilders);
D := ma(max( y - x,0),14,wilders);
however once again I was found wanting :S
Any help on this will be greatly appreciated.
|
Replies:
Posted By: JackNader
Date Posted: 07 Aug 2007 at 4:05pm
Is it possible to add a new bar in bullscript and give it a custom closing price? If I could defined hist(c,0) as my custom price and hist(c,1) as the most current price then it would be relatively simple to resolve this scripting issue. Ref should also work, however it truncates the lastbar so that P - C is not visible!
|
Posted By: blackdog
Date Posted: 09 Aug 2007 at 8:55am
JackNader
I tried to make a predictor for the MACD after attending a DiNappolli seminar last year. Check out my post "Just a step to the right"
Hope this helps.
|
Posted By: JackNader
Date Posted: 09 Aug 2007 at 5:18pm
Did you get it working Blackdog? Thx for the reply!
|
Posted By: SteveA
Date Posted: 21 Sep 2007 at 1:20am
If you have MS Access and know how to use it, why not just add a record to the history table? However, if you do this, be sure to delete the record again afterwards, otherwise you will not be prompted to download the daily data for that day, and could end up with a hole in your data for other securities. If you forget and mess up, any problems are easy to fix by saying that you want to download the data again, and then specifying the date range that you want to fix.
|
|