stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Need advise on this code
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3740
Page 1 of 5
Author:  fxcba [ Sat Jul 19, 2014 6:43 pm ]
Post subject:  Need advise on this code

Hello
I'm defenitely not a coder, but I'm learning (very slowly I have to admit :oops: ), I have problem on showing an indi value on main chart, text part is ok but only get zeroes instead the correct value, the indi is ATR
is this correct? : PATR=iATR(NULL,NULL,ATR_Period,0);
or should it be : PATR= iATR(NULL,0,ATR_Period;0);
both ways show on screen: ATR= 0,000000
what I'm missing?
Author:  milanese [ Sat Jul 19, 2014 6:59 pm ]
Post subject:  Need advise on this code

fxcba » Sat Jul 19, 2014 6:43 pm wrote:Hello
I'm defenitely not a coder, but I'm learning (very slowly I have to admit :oops: ), I have problem on showing an indi value on main chart, text part is ok but only get zeroes instead the correct value, the indi is ATR
is this correct? : PATR=iATR(NULL,NULL,ATR_Period,0);
or should it be : PATR= iATR(NULL,0,ATR_Period;0);
both ways show on screen: ATR= 0,000000
what I'm missing?
Hi iATR is used in this way:

double PATR=iATR(symbol,timeframe, period,shift);
symbol
Symbol name on the data of which the indicator will be calculated. NULL means the current symbol.

timeframe
Timeframe. 0 means the current chart timeframe.

period
Averaging period.

shift
0 means current bar, 1 previous closed bar and so on..

Cheers :)

Tommaso
Author:  fxcba [ Sat Jul 19, 2014 7:06 pm ]
Post subject:  Need advise on this code

Hi Tomasso
thank you for your answer
I've declared PATR as double, and text is shown on screen, why is no reading the value?

Is this correct?:
ObjectSetText("ATR",StringConcatenate("ATR: ",DoubleToStr(PATR)),14,"Tahoma",Yellow);
Author:  milanese [ Sat Jul 19, 2014 7:11 pm ]
Post subject:  Need advise on this code

fxcba » Sat Jul 19, 2014 7:06 pm wrote:Hi Tomasso
thank you for your answer
I've declared PATR as double, and text is shown on screen, why is no reading the value?
Maybe you can attach your complete code, than I will take a look, why it is not working as intended..

Cheers :)

Tommaso
Author:  fxcba [ Sat Jul 19, 2014 7:43 pm ]
Post subject:  Need advise on this code

milanese » Sat Jul 19, 2014 4:11 pm wrote:
fxcba » Sat Jul 19, 2014 7:06 pm wrote:Hi Tomasso
thank you for your answer
I've declared PATR as double, and text is shown on screen, why is no reading the value?
Maybe you can attach your complete code, than I will take a look, why it is not working as intended..

Cheers :)

Tommaso
Here you go
Author:  milanese [ Sat Jul 19, 2014 7:51 pm ]
Post subject:  Need advise on this code

attached the working version..
Adviser_V1.mq4
Cheers :)

Tommaso
Author:  fxcba [ Sat Jul 19, 2014 7:58 pm ]
Post subject:  Need advise on this code

Thank you buddy
I'll see what was wrong
Author:  fxcba [ Sat Jul 19, 2014 8:09 pm ]
Post subject:  Need advise on this code

Got it
that shows I know nothing :arrrg:
Author:  milanese [ Sat Jul 19, 2014 8:14 pm ]
Post subject:  Need advise on this code

fxcba » Sat Jul 19, 2014 8:09 pm wrote:Got it
that shows I know nothing :arrrg:
do not worry, we all started one day, good that you try to learn coding :good:

Cheers :)

Tommaso
Author:  fxcba [ Mon Jul 21, 2014 4:49 pm ]
Post subject:  Need advise on this code

Hello
Can somebody provide a template of a MA crossover an oscilator?
I'm in the task of create a WPR-MA cross, but I'm a little confused on how to perform the crossover :?
regards
Ric
All times are UTC Page 1 of 5