Need advise on this code

fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

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?
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Need advise on this code

Post by milanese »

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
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

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);
Last edited by fxcba on Sat Jul 19, 2014 7:22 pm, edited 1 time in total.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Need advise on this code

Post by milanese »

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
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

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
You do not have the required permissions to view the files attached to this post.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Need advise on this code

Post by milanese »

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

Tommaso
You do not have the required permissions to view the files attached to this post.
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

Thank you buddy
I'll see what was wrong
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

Got it
that shows I know nothing :arrrg:
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Need advise on this code

Post by milanese »

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
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

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
Post Reply

Return to “Coders Hangout”