Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 17:40:14 +0000



Orderflowanalytics-style reversal bars.

View Count: 30961

[2015-09-04 13:51:17]
crazybears - Posts: 314
Hi ejtrader

i don't think so , i can't try now but i think it's related to the code .
[2015-09-04 14:47:37]
Zdislav - Posts: 73
OK guys. Can you translate this to me please? What does it mean that it repaints? Do I understand it correctly that each momentum mark is painted again for every bar in the chart for every new loop? So manual looping should improve the performance?... sorry, but I am just "an ordinary guy" :-)
[2015-09-04 15:22:34]
ejtrader - Posts: 688
Zdislav - Haven't tested the momentum bars repaint issue myself.

But in general - If any of the plotted values change for Prior "closed" bars - It's called Re-paint. However if any values changes for the running last bar (bar which is NOT closed) - it's not usually called re-paint. Only if the values for current bar changes after processing logic moves to next bar - it can be categorized as repaint.

To re-iterate - A historical bar(except the very last bar on chart) should appear the SAME whether calculation are done in realtime or chart is re-loaded :)

Thanks
Date Time Of Last Edit: 2015-09-04 15:25:16
[2015-09-04 15:25:10]
crazybears - Posts: 314
Hi Zdislav

i meant that if you recalculate the indicator, some levels disappear and others are drawn
[2015-09-04 15:28:57]
crazybears - Posts: 314
yes as ejtrader said i meant for closed bar
[2015-09-04 15:30:54]
Zdislav - Posts: 73
ejtrader:
OK, I understand now. Thank you for explanation. Now, what can I do to improve it?
[2015-09-04 15:41:50]
User787778 - Posts: 139
Thanks for a study that shows promise.

Crazybears, I downloaded BetterRenko2, loaded it, but it would not work in a live environment. It froze. If you exit and re enter Sierra, it seams to calculate the bars correctly. Any advise?
[2015-09-04 16:14:53]
ejtrader - Posts: 688
Zdislav - I haven't had a chance to review the full study or had a chance to review the full code :)

However - One of the options I can think of - Check the momentum conditions only if the bar is closed as marked below.

PS: Was actually waiting for the volume cluster code as well before taking up on the full review of the code ;)

thanks



// Downside of checking this - it doesn't print the momentum bars in real-time for the very last bar.
if (sc.GetBarHasClosedStatus(sc.UpdateStartIndex) == BHCS_BAR_HAS_NOT_CLOSED)
    return;

for (int Index = sc.UpdateStartIndex; Index < sc.ArraySize; Index++)
{
const s_VolumeAtPriceV2 *p_VolumeAtPrice;
......
.....
}


Date Time Of Last Edit: 2015-09-04 16:28:53
[2015-09-04 16:25:23]
Zdislav - Posts: 73
ejtrader - got it... I will try... thanks a lot!
[2015-09-05 19:47:59]
crazybears - Posts: 314
@ User787778

hi , it's only a draft ,to use it set chat to 1 number of trade and use fews days
i've taken the code of better renko and i tried to change to make it similar to the flex renko bar with settings like 5-4-1
but with bars that have body without phantom levels , what i mean is flex renko bars could have bars that shows a size of 5 ticks but in reality have only 3 levels or even one level that shows real trades.
also the total number of bars are far less , chart needs less space and you can see longer period.
final target is to make bar adaptive to volatility but here i enter in realm of dreams :).
only way would be Sierra Chart Engineer make it a sc bar type as flex renko , maybe in a future ?
[2015-09-06 19:36:49]
crazybears - Posts: 314
Hi guys

please test this draft .
Date Time Of Last Edit: 2015-09-06 19:37:20
attachmentZdislav_OFA_Momentum2.cpp - Attached On 2015-09-06 19:37:09 UTC - Size: 4.93 KB - 593 views
[2015-09-06 20:35:53]
eagle - Posts: 92
The chart at the top of the image uses the cpp file that Petr posted in post #42, with the bear markers removed. The chart at the bottom uses crazybears' test cpp file from post #60.

Is this helpful?
imagetestimage.png / V - Attached On 2015-09-06 20:33:56 UTC - Size: 110.64 KB - 2092 views
[2015-09-06 20:49:25]
crazybears - Posts: 314
Hi eagle


replay chart , sometime pause it -> click studies ->select one of the 2 study-> click apply -> check if study repaint.
thanks
Date Time Of Last Edit: 2015-09-06 20:49:55
[2015-09-07 06:49:58]
Zdislav - Posts: 73
creazybears:
Thanks for the code review! I think the repainting may be solved.

I had this problem with my code: When the study calculated conditions for the current bar (not closed) it painted the mark at the moment all conditions were true, but if the condidtions changed (for example suddenly if there was one level less of strong prints on the ASK side) the mark remained printed. So when the bar closed, the print was still there. If I recalculated the study the print disapeared of course because there were just the last conditions. So that was the repainting... Your code corrects this issue I think.

Now, your code needs to be tweaked little bit. Your code prints the mark for all three levels, but there should be only one mark for the last level. Secondly, by the "memset" section of the code you erase all the marks in the given bar I think. Is it really important to use the memset?

Can the code look like this?
Date Time Of Last Edit: 2015-09-07 06:51:05
attachmentZdislav_OFA_Momentum2.cpp - Attached On 2015-09-07 06:50:53 UTC - Size: 4.04 KB - 632 views
[2015-09-07 07:40:00]
Zdislav - Posts: 73
My tip: A good way to check if the study works and prints marks correctly is to paint it over Numbers Bars study with Text Coloring Method set to Text on Diagonal Dominant Side and Column Compare Thresholds set to "38,138,162" (same as Weakness, Neutral, Strength compare thresholds in the Momentum study; only here it is in %). Column Range Colors then set to both Range 0 to "Blue" weakness, both Range 1 to "Gray" neutral, Range 2 Up to "greenish"/down to "redish" aka "less than strong but more than neutral", and Range 3 Up to "bright green"/Down to "bright red" strength.
Date Time Of Last Edit: 2015-09-07 07:45:03
[2015-09-07 11:12:08]
crazybears - Posts: 314
Hi Zdislav

i'm testing it ,your code seems to work better , only thing is draws levels < number of levels set
i use memset to clear the array , there is a better solution i think .

P.S.

code miss the function void at the end ;-)
[2015-09-07 17:49:15]
Zdislav - Posts: 73
Hi Max

The logic behind the momentum is, that it has to comply with the set number of level of conditions. In this case 1st level = 1st strong print, 2nd level = 2nd strong print and the 3rd level = 3rd strong print and this is the point, where all conditions are met. So the mark can be printed after the 3rd level. If 4th level is also strong print, additional mark is printed because all conditions are met. If the 5th level is NOT strong print, the mark cannot be printed, because the last level does not comply with all conditions and the number of condition levels is reset to zero and it starts all over again. I revised the code and it works much faster now when I implemented your method of diagonal comparison. I believe it does not repaint now. Speed of the code is convenient for use.

Zdislav
Date Time Of Last Edit: 2015-09-07 21:19:17
attachmentZdislav_OFA_Momentum.cpp - Attached On 2015-09-07 21:19:07 UTC - Size: 8.28 KB - 652 views
[2015-09-09 03:13:00]
NumbersBars - Posts: 141
Great effort here.
Latest version from Zdislav works great in terms of loading time.

An ACSIL question, instead of triangle up/down, is it possible to replace them with Ray or horizontal line with extension option such as" Until future intersection".

This option will help to alert trader when price revisits the previous strong momentum levels.
[2015-09-09 11:01:18]
Zdislav - Posts: 73
Here is the complete pack of OFA tools. Exhaustion needs an update, because it just doesn't draw as expected. For Cluster analysis and Momentum I am experiencing some weird behavior during current bar (bar has not closed yet)... Can somebody check on this please? It seems that if the price moves to a certain level, then the function for filling the VAPcontainer just swaps its direction or something like that... Drawing VWAP works only for DVP tool which was updated as last... but it works.

Petr
Date Time Of Last Edit: 2015-09-09 12:19:23
attachmentZdislav_OFA.cpp - Attached On 2015-09-09 11:00:56 UTC - Size: 28.36 KB - 1080 views
attachmentZdislav_OFA.dll - Attached On 2015-09-09 12:19:14 UTC - Size: 74 KB - 864 views
[2015-09-09 12:12:01]
cmet - Posts: 536
This doesn't compile for me in the latest version.

-- Starting build of Custom Studies Source files: Zdislav_OFA.cpp. -- 04:56:15

"C:\SierraChart\CPPCompiler\bin\g++.exe" "C:\SierraChart\ACS_Source\Zdislav_OFA.cpp" -march=i686 -mtune=i686 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -std=gnu++11 -o "C:\SierraChart\Data\Zdislav_OFA.dll"

C:\SierraChart\ACS_Source\Zdislav_OFA.cpp: In function 'void scsf_Zdislav_OFA_Bars(SCStudyInterfaceRef)':
C:\SierraChart\ACS_Source\Zdislav_OFA.cpp:257:15: error: exception handling disabled, use -fexceptions to enable
catch (char *ErrMsg)
^
C:\SierraChart\ACS_Source\Zdislav_OFA.cpp:259:22: error: 'ErrMsg' was not declared in this scope
sc.AddMessageToLog(ErrMsg, 1);
^
-- End of Build -- 04:56:15


No dll file is produced.
[2015-09-09 12:13:57]
Zdislav - Posts: 73
Try to compile it with this parameter...

-fexceptions

I uploaded compiled DLL into my previous post. It is compiled in VS2012, so I hope it will work...
Date Time Of Last Edit: 2015-09-09 12:26:28
[2015-09-09 12:59:47]
ejtrader - Posts: 688
Zdislav - Really appreciate taking up this huge task and sharing this :)

For few of the studies - you have sc.FreeDLL set to '1'. This could potentially be causing the erratic behavior that you have described - when used with containers (atleast have observed weird behavior in the past when custom containers are used with sc.FreeDLL set to 1).

Please set to '0' and see if the behavior you notice is the same.

Edit - However the weird behavior you are describing doesn't seem to be related to that and something else.

Thanks
Date Time Of Last Edit: 2015-09-09 13:38:29
[2015-09-09 15:51:01]
crazybears - Posts: 314
Hi Zdislav

i'll take a look later , thanks for your efforts
[2015-09-10 02:27:41]
NumbersBars - Posts: 141
Hi Zdislav,
I was testing the volume cluster part of your latest code.
I've found in some occasions, your OFA Bar POC is different from the real Bar POC as indicated by number bar.

Are they supposed to be the same? let me know if I misunderstand the logic behind OFA.

I have attached the screenshot of number bar.
Date Time Of Last Edit: 2015-09-10 02:42:19
imageOFA Bar POC.png / V - Attached On 2015-09-10 02:26:14 UTC - Size: 53.37 KB - 2011 views
[2015-09-10 05:41:37]
Zdislav - Posts: 73
CGM:
Thanks for the review. Of course it should be the same. I haven't encounter this issue yet... I will look at it. But what is more important is the cluster anyway...

Edit - OK, so I have some of POCs also wrong but I do not know where the problem is yet.
Date Time Of Last Edit: 2015-09-10 08:44:15
[2015-09-16 04:17:21]
NumbersBars - Posts: 141
Hi Zdislav,
I was testing OFA Bars. May I know what is the base chart I need to load before applying OFA Bar?
I was comparing chart posted by DB on his youtube videos, there are some difference, so just wondering if I am using the indicator correctly.

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

Login

Login Page - Create Account