QuestionCandle body size help

#1
Hi everyone from Italy, I'm new to these parts, sorry if my English is not perfect, I help google translator ...
I need help with a code that works, but what it needs to do is do it in real time, while I want the code to run only when the candle is closed.
The attached code measures the body (only the body) of each candle from open to close and if it exceeds a certain value that I can set as input it puts an arrow over hight or below the candle low.
EXAMPLE: close-open = 9: if I set my input> = 8 in this case it puts an arrow over the hight of the candle, if the value found was <8 it would do nothing.
On the contrary for negative candles.
It works, but it does all the real time so it puts arrows on the candles that at that time are> = to my input, but when the candle closes the body smaller than the one requested, so I ask if it is possible to make the code be performed only with the candle closed.

Thanks bye
Candle Body.mq4
(2.73 KiB) Downloaded 371 times


Re: Candle body size help

#2
pedro wrote:
Mon Aug 26, 2019 1:27 am
Hi everyone from Italy, I'm new to these parts, sorry if my English is not perfect, I help google translator ...
I need help with a code that works, but what it needs to do is do it in real time, while I want the code to run only when the candle is closed.
The attached code measures the body (only the body) of each candle from open to close and if it exceeds a certain value that I can set as input it puts an arrow over hight or below the candle low.
EXAMPLE: close-open = 9: if I set my input> = 8 in this case it puts an arrow over the hight of the candle, if the value found was <8 it would do nothing.
On the contrary for negative candles.
It works, but it does all the real time so it puts arrows on the candles that at that time are> = to my input, but when the candle closes the body smaller than the one requested, so I ask if it is possible to make the code be performed only with the candle closed.

Thanks bye
Hello, sorry, will you show me a picture with the indicator working with the arrows? Thanks.
The perfect indicatoris our head ...

Too many indicators confuse the head

Re: Candle body size help

#5
pedro wrote:
Mon Aug 26, 2019 2:39 am
green and fuchsia arrows

hallo
Have you tried this way?
Hai provato in questo modo?
Delta=Close[pos+1]-Open[pos+1];PosizioneS=Low[pos+1]-5;PosizioneL=High[pos+1]+5;
The perfect indicatoris our head ...

Too many indicators confuse the head


Re: Candle body size help

#6
hello, with the change you made the arrow has moved to the right of a candle not indicating the correct candle, then I don't know if the problem of real time you managed to solve it ...
body 2.JPG

Re: Candle body size help

#7
pedro wrote:
Mon Aug 26, 2019 1:27 am
Hi everyone from Italy, I'm new to these parts, sorry if my English is not perfect, I help google translator ...
I need help with a code that works, but what it needs to do is do it in real time, while I want the code to run only when the candle is closed.
The attached code measures the body (only the body) of each candle from open to close and if it exceeds a certain value that I can set as input it puts an arrow over hight or below the candle low.
EXAMPLE: close-open = 9: if I set my input> = 8 in this case it puts an arrow over the hight of the candle, if the value found was <8 it would do nothing.
On the contrary for negative candles.
It works, but it does all the real time so it puts arrows on the candles that at that time are> = to my input, but when the candle closes the body smaller than the one requested, so I ask if it is possible to make the code be performed only with the candle closed.

Thanks bye
Pacois give me this indicator some time ago, show an arrow when the body of the candle exceeds certain pips quantity. You can change the size in the setting.
The arrow appears in current candle formation and stay there if conditions meet.
candle.png
candle-size-alert-mt4-indicator.mq4
(8.61 KiB) Downloaded 800 times

Re: Candle body size help

#8
pedro wrote:
Mon Aug 26, 2019 6:38 am
hello, with the change you made the arrow has moved to the right of a candle not indicating the correct candle, then I don't know if the problem of real time you managed to solve it ...
try!!
Candle Body2.mq4
(3.9 KiB) Downloaded 381 times
The perfect indicatoris our head ...

Too many indicators confuse the head

Re: Candle body size help

#9
Hi Pacois, there is still the problem of real time.
I sent you 2 attachments to show you:
the first attachment "body" shows all the arrows that the code puts in real time and I put 2 yellow arrows that indicate that those 2 candles should not have the arrow because the body with a candle closure is smaller than that required by the code.
In the second attachment "body2" I restarted the code and shows the arrows on the right candles.
In practice, the code must analyze the candle after the closure is not in real time.

hello Fabio
Body.JPG
body 2.JPG
Candle Body2.mq4
(3.91 KiB) Downloaded 380 times

Re: Candle body size help

#10
pedro wrote:
Mon Aug 26, 2019 8:09 pm
Hi Pacois, there is still the problem of real time.
I sent you 2 attachments to show you:
the first attachment "body" shows all the arrows that the code puts in real time and I put 2 yellow arrows that indicate that those 2 candles should not have the arrow because the body with a candle closure is smaller than that required by the code.
In the second attachment "body2" I restarted the code and shows the arrows on the right candles.
In practice, the code must analyze the candle after the closure is not in real time.

hello Fabio
did you mean the previous bar should confrim the value not the current bar close bar..


Attachments 11
  1. Similar Topics

    1. Best position size calculator MT4

      8 Replies 550 Views

      by YeshuaYoke, Mon Feb 15, 2021 11:03 am in MT4 Indicators

      8 Replies
      550 Views
    2. Help changing the lot size function in this ea

      0 Replies 264 Views

      by gabriel888, Sat Aug 22, 2020 6:11 am in Coding Help

      0 Replies
      264 Views

Return to “Coding Help”