If i have a simple printf() statement like printf("hi"); or like in the example in manual,
when interpretation window is not visible code runs "fine"
but when we switch to interpretation window I get this crash window which doesn't recover.
thanks
AmiBroker version 6.49.0.6490
( 64-bit, cooltool.dll 6.49.0, mfc42.dll 6.49.0, msvcrt.dll 7.0.22621 )
Microsoft Windows 10 version 10.0 (Build 22621)
Service Pack 0.0, Common Controls: 6.16
Sorry I can confirm that int() is a no-op in 6.49.0. This is side effect of some internal experiments that I made and forgot to disable before release.
As a temporary workaround use floor ( for positive numbers) or ceil (for negative numbers)
In the future int() will be marked as obsolete to be replaced by trunc() which will provide same functionality under different name.
Python script replacing int() with trunc() in all AFL files in the folder "path_src"
import os
from multiprocessing.dummy import Pool as ThreadPool
path_src = 'D:/Soft/AmiBroker/' # folder with subfolders with AFL files
def replace_text(file_name):
print(file_name)
# read from AFL file
with open(file_name, 'r') as file :
filedata = file.read()
file.close()
# replace 'int(' with 'trunc('
filedata = filedata.replace(' int(', ' trunc(')
filedata = filedata.replace(' int(', ' trunc(')
filedata = filedata.replace('=int(', '=trunc(')
filedata = filedata.replace('(int(', '(trunc(')
# write to AFL file
with open(file_name, 'w') as file:
file.write(filedata)
if __name__ == '__main__':
files_list = []
# read files from all subfolders of path_src
for root, dirs, files in os.walk(path_src):
for name in files:
filename, file_extension = os.path.splitext(name)
if file_extension=='.afl':
files_list.append(str(os.path.join(root, name)))
# multithread execution
pool = ThreadPool()
pool.map(replace_text, files_list)
pool.close()
pool.join()
So I understand this and fully get my head around this...
1.) Is the MAP global meaning it resides outside a specific ticker or tied to the ticker? Example can it hold ranking metrics per date/bar?
2.) As each symbol processes it's own ALF script (Array processing) does the map still exist or does it need to be created again within that symbols AFL?
3.) Are the MAPS static?
4.) Can a specific key have a value that is an array? Or could we just create a CSV string for the Value that holds multiple values, as long as we manually manage the CSV string fields well?
5.) Is the amount of Key/Value pairs limited to BarCount like normal AFL array processing, or set/initialized to whatever length, and/or is it dynamic, meaning it key/values can be added to and deleted from?
The cost of upgrade is $189 for Professional edition for two years of upgrades. That is $7.89 per month. The users who live in North America can't even buy a glass of wine or glass of bear in restaurant for that. I keep myself current, not because I can use or even know how to use every feature he adds, because for this product to survive it has to make financial sense to Tomasz. Most of do things for money or love. If you are not giving him money, al least give him love by thanking him.
Maps are the same as any other variable. There is nothing special about them other than they keep key-value pairs (they are like arrays but instead of numerical index you have string key)
They exist within formula (not outside)
Again, maps are not different than any other type. The lifetime is during formula execution. Each execution is SEPARATE, just like in any other variable
No they are not.
Yes it can. As I wrote before 'value' can be of any type.
Anyone else feeling AddComposite taking a lot longer to finish in this version ?
In previous version the AddComposite phase of my batch was done in seconds, but now it stops during the process and sometimes take many minutes to finish.
I thought could be something to do with data plugin, but even in local database I see the same delay.
Actually it IS FASTER, if only application has some "idle" time.
In current version composites are processed in "idle" time in batches and that generally leads to BETTER speed as windows message queue is NOT strained.
But it requires IDLE time. Application can't be busy all the time doing other "more important" stuff.
Your setup probably is BUSY all the time and does not get any "idle" time.
Application is idle when it does not have any messages to process in the application message queue.
You don't stay what is your config and what data source is but if data source is not peforming well it might make CPU busy all the time.