Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 18:33:17 +0000



[User Discussion] - Offering To The Community: Brett Johnson's Standard Tool Kit

View Count: 16757

[2019-02-12 05:55:38]
bjohnson777 (Brett Johnson) - Posts: 284
Minor update to Forex Currency Decorrelation and Currency Strength to compile with the new SC version.
[2020-07-10 19:45:06]
bjohnson777 (Brett Johnson) - Posts: 284
Minor update to fix Multi Function Trailing Stop to compile with the new SC version.
[2020-07-10 22:15:45]
ForgivingComputers.com - Posts: 960
Hi Brett,

Thank you for sharing your toolkit. I started to use the debug_PrintOrders function when I needed to learn about reading trade lists, but I was getting strange results. The PositionQuantity was printing 0 when it should be returning a non-zero value.

I was able to get it right when I added (int) to the Quantity lines:

  fprintf(FileOut, " PositionQuantity: %d\n", (int)PositionData.PositionQuantity);

It then worked. Could be I am using the Visual C++ compiler? I usually don't' use the remote compiler. I tested on Sierra versions 2092 and 2128.

Best wishes,
Brad Houser
[2020-07-12 21:49:41]
bjohnson777 (Brett Johnson) - Posts: 284
That's odd...
I haven't used debug in a long time. From the ACSIL documentation:
[Type: integer] PositionQuantity
%d in printf is an unsigned int.
It should have been auto-cast if it wasn't. BUT... it doesn't say what size of an int it is, but may not care.

I always use open source stuff, so am unsure about VC++.

Maybe you could try %ld for "long int" just to see what happens?

If you use the remote compiler, does it work without the (int) cast? I don't think you have to reconfigure your setup to test.
[2020-07-12 22:00:17]
ForgivingComputers.com - Posts: 960
If you use the remote compiler, does it work without the (int) cast? I don't think you have to reconfigure your setup to test.

I think they made it a double for fractional quantities, at least on Win64.

All the Quantities are type t_OrderQuantity32_64.

Structures.h has this:

#ifdef _WIN64
typedef double t_OrderQuantity32_64;//TODO: Use this only when change to SCDateTimeUnix
#else/*
#ifdef _DEBUG
typedef double t_OrderQuantity32_64;
#else*/
typedef int t_OrderQuantity32_64;
//#endif
#endif

Look like the key is _WIN64.

Thanks for your reply,
Brad
[2020-07-12 22:17:45]
bjohnson777 (Brett Johnson) - Posts: 284
I just traced that in my scstructures.h also in v2135. The "SCDateTimeUnix" comment doesn't makes sense in reference to a quantity count. That may be a benign bug (for the most part).
[2020-09-16 09:32:55]
bjohnson777 (Brett Johnson) - Posts: 284
Minor update to Forex Currency Decorrelation and Custom Stock Index Creator to compile with SC 2168.
[2022-01-23 04:39:50]
User169391 - Posts: 62
Hi Brett,
Hope your are keeping well. I have just updated to sierra version 2348. I now get an error message when recompilling the brett johnson standard tool kit. The main study I use is the forex decorrelation and strength study. Love this study and is the back bone of my trading strategy. Many thanks. Hoping the problem can be resolved.

Colin Alchin
[2022-06-29 15:54:42]
Matador Trader - Posts: 24
Is this still supported? I can't seem to get it to compile in the current version of sierra.
[2022-07-10 07:38:32]
bjohnson777 (Brett Johnson) - Posts: 284
SC dev's changed a bunch of variable names and broke things. It should compile with 2411 now.

As my health has gotten worse this year, I don't have time nor energy to do much with this.
[2022-07-11 06:52:33]
sjkafeero - Posts: 21
We will keep you in our prayers. Your work has truly blessed us in our trading profitably immensely. You are a valued member of the community.
[2022-07-11 14:49:38]
bjohnson777 (Brett Johnson) - Posts: 284
Thanks, I need them. Since I can't move quickly, I recommend backing up the full SC directory before any upgrades. That way if an upgrade breaks something important, you've got an easy fall back.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account