What can change barsback? [solved]

Have a QScript to share, or need help with programming? Post your comment here.
Post Reply
sbank
Posts: 83
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

What can change barsback? [solved]

Post by sbank » Sat May 12, 2018 11:52 pm

I am seeing a very odd problem. I may just open a support ticket, but thought I would put this out to he general population.

I created a QScript, that has reference bars set to '50'. After building the script, I can confirm this is set to 50 if I bring up the .conf59 file in notepad. EG:

Code: Select all

PLOT:

BARSBACK:
50
SCALE:
1
UPDATE_EVERY_TICK:
0
HOTSPOTS:
0
INPUTS:
When I go to put this QScript on a chart, the properties shows that the number of reference bars are set to '110' (not 50). If I go to edit the 110 (back to 50), it just gets ignored and stays as 110.

I am not doing anything weird in my QScript that I think would adjust this parameter. And I have never noticed this before for my other QScripts.

Some troubleshooting steps I tried:
* I tried cut-n-pasting the script contents to a brand new name of a file (with reference bars set originally to 50). This new file also goes to 110 after it is built and added to a chart.
* i have rebooted my PC; re-started Wave59.
* like I mentioned, i looked at the raw file to see if it was somehow corrupt. But that shows 50.
* I am going to try the QScripot debugger now... (So I will report back if I find anything.)

Any other thoughts?

thx

EDIT: Solved thanks to Kenn! I recently made a change to incorporate a very large AMA hardcoded length to my script. I was using this as a basic, "trade with the general trend" idea. Unfortunately the rest of my script is highly dependent on the certain barsback size, so when my reference number of bars increased, it threw off the other bits and pieces of my calculations.
Last edited by sbank on Sun May 13, 2018 7:20 pm, edited 2 times in total.

kjociii
Posts: 12
Joined: Tue Jul 21, 2015 9:15 pm
Contact:

Re: What can change barback?

Post by kjociii » Sun May 13, 2018 5:24 pm

Hi Sbank,

W59 will update barsback on the fly to whatever the maximum barsback it needs to make the calculations. Take a look at any offsets you have in your code (ie close[xxx]) and you should be able to find a place where the reference can go back farther than 50 bars.

A way to debug this is to change all your offset references to a static number, which should result in barsback staying at 50. Next start adding the variable references back in one by one. When you find barsback changing from the 50 value, that will be the offending piece of code.

Good luck!
Kenn
Wave59 Solution Provider
Custom QScript Programming
kenn@scriptbuilder.net

sbank
Posts: 83
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

Re: What can change barback?

Post by sbank » Sun May 13, 2018 5:28 pm

Ooo. Interesting. I was about to start "REMming" out bits and bits of code to figure out if there was something causing this. I'll look at all my offsets and will reply back.

thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests