Big Body Candle

Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • #140874 quote
    robertogozzi
    Moderator
    Master

    Sorry, but I can’t get what you mean.

    Let’s recap (no pics are needed) what you want to be returned, as a list:

    1) …

    2) …

    3) …

    and, for each one of the poiunt, please specify if it has to be calculated on regular japanese candlesticks or HA candlesticks.

    As you can see from the attached pic on Jul.30 at 11:05 (Utc + 10), which is 03:05 (Utc + 2 in Central Europe). the body of the regular candle is lower than the highest bodysize and it’s a bearish japanese candlestick. while at the same time there a bullish HA candlestick with a different body size.

    You need to let me know every detail to be able to help you.

    x-1.jpg x-1.jpg
    #141733 quote
    parthapersonal
    Participant
    Average

    Thank you Robert and sorry for the delay in response. The problem is: the values of “Highline” and “Lowline” is changing with each bar. they should only change according to the code. I tried the condition code as

    // Creating high and low lines for the "BIGBODY"
    if cond=1 then
    lowline=low
    elsif cond=-1 then
    highline=high
    endif

    Moderators Edit: Use the ‘Insert PRT Code’ button whenever you post code!

    but it did not change anything

    Here is a situation as below for ASX 200 (Australia 200 Cash A$1) in 5 min chart:

    1. Date and time:  Sat 15-Aug-2020 01:50 (Our time zone (TZ) is UTC+ 10 and we are using PRT (v10.3 – 1.8.0-_202) from IG)

    2. The bar is bearish with bigbody (with P=15)

    3. Cond=-1, highline= high (6095.1)

    4. Date and time:  Sat 15-Aug-2020 02:00, Cond=-1, highline should be= 6095.1 but it is changing to current bar’s high as 6095.6

    5. Date and time:  Sat 15-Aug-2020 02:35, Cond=-1, highline should be= 6095.1 but it is appearing as current bar’s high as 6096.1

    6. High (6096.1) of this Heikin Ashi> highline (6095.1)

    7. Heikin Ashi close (6094.4) <  highline (6095.1)

    8. Condition in code is matching (<span class=”crayon-st”>ELSIF</span> cond<span class=”crayon-o”>=</span><span class=”crayon-o”>-</span><span class=”crayon-cn”>1</span> <span class=”crayon-st”>AND</span> HH<span class=”crayon-o”>></span>highline <span class=”crayon-st”>AND</span> HC<span class=”crayon-o”><</span>highline <span class=”crayon-st”>THEN </span>OBS<span class=”crayon-o”>=</span><span class=”crayon-o”>-</span><span class=”crayon-cn”>64) but histogram is not appearing as highline is changing with each bar.
    </span>

    9. Another problem is there are so many histograms are appearing (marked in the chart as “x”) without conditions matching.

    Your assistance will be much appreciated.

    Missing-Extra-Signals-1.jpg Missing-Extra-Signals-1.jpg
    #141735 quote
    parthapersonal
    Participant
    Average

    Please read point number 8. as ELSIF cond=-1 AND HH>highline AND HC<highline THEN
    OBS=-64

    #141742 quote
    robertogozzi
    Moderator
    Master

    I prefer to restart from the beginning.

    You have an idea and you want someone to code it to have a working indicator that makes it easier for you to trade. Now forget all you have written so far and explain me, as I said in my post https://www.prorealcode.com/topic/big-body-candle/page/2/#post-140874, what you expect from this indicator.

    It will be much easier for me to code it from scratch.

    #141837 quote
    parthapersonal
    Participant
    Average

    OK, Robert. Here it is:

    The outcome from the program should be to get trigger from current price if it is touching or going higher than the high (say BH) of the biggest body bearish bar within last 15 bars and closing below BH. Similarly on the opposite direction, program should generate trigger from current price if it is touching or going lower than the low (say BL) of the biggest body bullish bar within last 15 bars and closing above BL.

    Have I made it clear enough or you need any other information, mate?

    Many thanks.

    #141860 quote
    robertogozzi
    Moderator
    Master

    There you go, the first one is to be added below your chart (like Macd):

    DEFPARAM CalculateOnLastBars = 1000
    ONCE LookBackBars = 15
    Bullish = close > open
    Bearish = close < open
    Body    = abs(close - open)
    BigBull = 0
    BigBear = 0
    HH      = 0
    LL      = 0
    FOR i = 1 TO LookBackBars
    IF Bearish[i] THEN
    IF Body[i] > BigBull THEN
    BigBull = Body[i]
    HH      = high[i]
    ENDIF
    ELSIF Bullish[i] THEN
    IF Body[i] > BigBear THEN
    BigBear = Body[i]
    LL      = low[i]
    ENDIF
    ENDIF
    NEXT
    x = 0
    IF high CROSSES OVER HH THEN
    x = 1
    ELSIF low CROSSES UNDER LL THEN
    x = -1
    ENDIF
    RETURN x AS "Signal"

    the second can be added both below or ON your chart:

    DEFPARAM CalculateOnLastBars = 1000
    ONCE LookBackBars = 15
    Bullish = close > open
    Bearish = close < open
    Body    = abs(close - open)
    BigBull = 0
    BigBear = 0
    HH      = 0
    LL      = 0
    FOR i = 1 TO LookBackBars
    IF Bearish[i] THEN
    IF Body[i] > BigBull THEN
    BigBull = Body[i]
    HH      = high[i]
    ENDIF
    ELSIF Bullish[i] THEN
    IF Body[i] > BigBear THEN
    BigBear = Body[i]
    LL      = low[i]
    ENDIF
    ENDIF
    NEXT
    RETURN HH AS "HH",LL AS "LL"
    #141921 quote
    parthapersonal
    Participant
    Average

    Many thanks Robert, much appreciated your effort. However your 2nd code is only identifying  big body bars. This is not required. What is required is when low of a bar touches or goes below the low of bullish big body bar’s low then it should generate a bullish signal and when high of a bar touches or goes above the high of bearish big body bar’s high then it should generate a bearish signal. If you please fix this please.

    thank you again.

    #141935 quote
    robertogozzi
    Moderator
    Master

    Just use the first one.

    #141957 quote
    parthapersonal
    Participant
    Average

    Robert, you are a real genius.

    Many thanks dear.

    You have a very big and noble heart.

    #141958 quote
    parthapersonal
    Participant
    Average

    Hello Robert, there are some missing signals as captured with your original signal code (bottom one BigBodysignal (18)) as well with a small modifications as below (top one Big Body signal (18)):

    IF high CROSSES OVER HH AND CLOSE<HH THEN
    x = -5
    ELSIF low CROSSES UNDER LL AND CLOSE>LL THEN
    x = 5
    ENDIF

    Missing-signals.jpg Missing-signals.jpg
    #141960 quote
    robertogozzi
    Moderator
    Master

    Because LOW is not crossing under in that case.

    If you just need it to be below/above simply replace CROSSES UNDER with <= and CROSSES OVER with >=.

    #142053 quote
    parthapersonal
    Participant
    Average

    Many thanks dear. Much appreciated.

Viewing 12 posts - 16 through 27 (of 27 total)
  • You must be logged in to reply to this topic.

Big Body Candle


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 26 replies,
has 2 voices, and was last updated by parthapersonal
5 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/29/2020
Status: Active
Attachments: 5 files
Logo Logo
Loading...