Coding help - page 458

 
AchiJameson:
Ok thank u very much... is that difficult to add ma filter and a non profit trailingstop?

i know all people ask you for help its sometimes irritating pls help just when u have the time and if u want..

Thanks in Advance Achi

AchiJameson

Using the volume (number of ticks) as a directional signal for trading is not a good idea (since ricks can not show any direction). Better to use something else (so, to have an EA based on something completely else)

 

Hi there,

Please help fix this indicator heiken_ashi_smoothed-alert--bug.mq4

It is HASmoothed but is giving constant messages, several per second, in "Experts" tab, something like heiken ashi smoohter, symbol, timeframe:0thus giving fan whirring and I assume log files...

I'd really appreciate if it could be fixed to not do this but otherwise keep same

 
zigflip:
Hi there,

Please help fix this indicator heiken_ashi_smoothed-alert--bug.mq4

It is HASmoothed but is giving constant messages, several per second, in "Experts" tab, something like heiken ashi smoohter, symbol, timeframe:0thus giving fan whirring and I assume log files...

I'd really appreciate if it could be fixed to not do this but otherwise keep same

zigflip

Here you go : heiken_ashi_smoothed-alert.mq4

 

Hello,

I am working on an indicator that works with the difference between Close i and the previous close (Close i-1 ). The indicator line is based on the indexbuffer a1. Below is the code.

for(i=0;i<=limit;i++) {

a1 = Close-Close;

}

This doesent work. There is an indicatorline, but at the right end (at the most recent bar) of the indicator line it remains static and fixed at a certain level. The same happens when i use the code Close-Open; for example.

Why does this happen???? Could someone explain what i am doing wrong and how i can fix this?

Thanks in advance.

 
mladen:
zigflip Here you go : heiken_ashi_smoothed-alert.mq4

wow thank you very much, i will try it soon

 
mrcodix:
Hello,

I am working on an indicator that works with the difference between Close i and the previous close (Close i-1 ). The indicator line is based on the indexbuffer a1. Below is the code.

for(i=0;i<=limit;i++) {

a1 = Close-Close;

}

This doesent work. There is an indicatorline, but at the right end (at the most recent bar) of the indicator line it remains static and fixed at a certain level. The same happens when i use the code Close-Open; for example.

Why does this happen???? Could someone explain what i am doing wrong and how i can fix this?

Thanks in advance.

change the

a1 = Close-Close;

to

a1 = Close-Close;

In mql, i+1 means previous element

 

haha, diden't know the solution was that simple. Thanks allot Mladen!

 

Hello guys. I am looking for help with one old indicator (attached). The indicator is not calcualting properly. The indicator should calculate the distances from open to high or low depending on if the bar is bearish or bullish. Then it should average the result by number of bars we choose - and here is the issue. It should work like this: if I choose period 10 bars it means I want to calculate the values from last 10 down-bars and last 10 up-bars, but now it just calculate the value of up-bars or down-bars contained in the last 10 bars absolutely. For examply in last 10 bars was 5 up-bars and 5 down-bars - in this case the value calculated is actually not for last 10 bars, but for last 5 bars. Hopefully it is understandable, if not I will try to explain it better :-) I am quite helpless looking into the code myself :-/

Files:
gsv-v1.mq4  3 kb
 
Unca:
Hello guys. I am looking for help with one old indicator (attached). The indicator is not calcualting properly. The indicator should calculate the distances from open to high or low depending on if the bar is bearish or bullish. Then it should average the result by number of bars we choose - and here is the issue. It should work like this: if I choose period 10 bars it means I want to calculate the values from last 10 down-bars and last 10 up-bars, but now it just calculate the value of up-bars or down-bars contained in the last 10 bars absolutely. For examply in last 10 bars was 5 up-bars and 5 down-bars - in this case the value calculated is actually not for last 10 bars, but for last 5 bars. Hopefully it is understandable, if not I will try to explain it better :-) I am quite helpless looking into the code myself :-/

What would you do in a case, just as an example, when last 100 bars are bar up, and there is no bar down? In that case, bar down average should be 0 (in my opinion) and in that case your code is working OK

 

Then it should take the values from the last desired amount of bars anyway - even 100 bars before. It means it would show the same value (for down bars) for last 100 bars.

Reason: