Generic Two Indicator Distance Overlay

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Generic Two Indicator Distance Overlay

Postby Apprentice » Sun Jul 24, 2022 4:59 am

EURUSD H8 (07-24-2022 1155).png

Based on the request.
https://fxcodebase.com/code/viewtopic.php?f=17&t=72546

Find the difference between any two indicators and color the candle one color when the difference exceeds a user-defined threshold and another color when it falls below the threshold.
Generic Two Indicator Distance Overlay.lua
(10.5 KiB) Downloaded 32 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 32037
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Generic Two Indicator Distance Overlay

Postby Sheera123 » Sun Jul 24, 2022 9:56 am

Hi Apprentice,

Thanks for creating the indicator. But it doesn't seem to be detecting when the difference is above or below the threshold. See attached pic for an example of what I want it to show. I am assuming, "Candle Color Level" is the threshold value and when I set it higher that 0, all the candles are colored with the same color.

I think you will have to add a 3rd color for when the difference is below the threshold. So the logic would be like this:

Up/Down trend:
1 - If 1st indicator is above 2nd indicator and difference is greater than threshold, color 1.
2 - If 1st indicator is below 2nd indicator and difference is greater than threshold, color 2.

Range:
3 - If 1st indicator is above 2nd indicator and difference is less than threshold, color 3.
4 - If 1st indicator is below 2nd indicator and difference is less than threshold, color 3.

The difference between the 1st and 2nd indicator is measured in pips.

Hope this makes it a bit clearer.

Thanks again,
Shawn H.
Attachments
Untitled.png
Sheera123
 
Posts: 54
Joined: Tue Jun 05, 2018 1:08 pm


Re: Generic Two Indicator Distance Overlay

Postby Sheera123 » Wed Jul 27, 2022 6:52 am

Works as expected now. Now I just have to play around with it to see which combination of TF and indicators gives the best results.

Thank you very much.

Shawn H.
Attachments
Untitled.png
Sheera123
 
Posts: 54
Joined: Tue Jun 05, 2018 1:08 pm



Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot] and 5 guests