How to get daily ADX value on 20mins time frame?(MC8.8)

Questions about MultiCharts and user contributed studies.
yungcross1
Posts: 4
Joined: 27 Dec 2013
Has thanked: 2 times

How to get daily ADX value on 20mins time frame?(MC8.8)

Postby yungcross1 » 05 Jan 2014

I use the code below:
I can get the daily ADX corrcet value.
Could you give me some suggestions?

Thank you.

variables:
var0( 0 ) , var1(0) , var2(0) , TradeSignal(0) , PosSize(0) , ADXNUM(0,data2);

var0 = BollingerBand( BollingerPrice, Length, -NumDevsDn ) ;
var1 = BollingerBand( BollingerPrice, Length, 0 ) ;
var2 = BollingerBand( BollingerPrice, Length, NumDevsDn ) ;



condition1 = CurrentBar > 1 and TestPriceLBand crosses over var0 and ADX(15) of data2 < ADXNUM;
condition2 = CurrentBar > 1 and (TestPriceLBand crosses under var1);
condition3 = CurrentBar > 1 and TestPriceLBand crosses under var2 and ADX(15) of data2 < ADXNUM;
condition4 = CurrentBar > 1 and (TestPriceLBand crosses over var1 );

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: How to get daily ADX value on 20mins time frame?(MC8.8)

Postby TJ » 05 Jan 2014

I use the code below:
I can get the daily ADX corrcet value.
Could you give me some suggestions?
Thank you.
variables:
var0( 0 ) , var1(0) , var2(0) , TradeSignal(0) , PosSize(0) , ADXNUM(0,data2);
var0 = BollingerBand( BollingerPrice, Length, -NumDevsDn ) ;
var1 = BollingerBand( BollingerPrice, Length, 0 ) ;
var2 = BollingerBand( BollingerPrice, Length, NumDevsDn ) ;
condition1 = CurrentBar > 1 and TestPriceLBand crosses over var0 and ADX(15) of data2 < ADXNUM;
condition2 = CurrentBar > 1 and (TestPriceLBand crosses under var1);
condition3 = CurrentBar > 1 and TestPriceLBand crosses under var2 and ADX(15) of data2 < ADXNUM;
condition4 = CurrentBar > 1 and (TestPriceLBand crosses over var1 );
What kind of suggestion you are looking for?

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: How to get daily ADX value on 20mins time frame?(MC8.8)

Postby TJ » 05 Jan 2014

ps.
[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713

yungcross1
Posts: 4
Joined: 27 Dec 2013
Has thanked: 2 times

Re: How to get daily ADX value on 20mins time frame?(MC8.8)

Postby yungcross1 » 05 Jan 2014

Sorry for that.
I am the newbie.
I can't get the correct daily value of ADX on 20 mins time frame.
I try the Global Variables,but it seems that it only plot the last value.
set:

Code: Select all

GVSetNamedDouble("Box",ADX(30));
get:

Code: Select all

var0 = GVGetNamedDouble("Box",0);
// Plot them
Plot1(var0 , "ADX");
Could the Global Variables can be used in optimizing?
Or I should use ADE to do that?
Or it can be done using data2?

Thank you.

Code: Select all

variables:
var0( 0 ) , var1(0) , var2(0) , TradeSignal(0) , PosSize(0) , ADXNUM(0,data2);

var0 = BollingerBand( BollingerPrice, Length, -NumDevsDn ) ;
var1 = BollingerBand( BollingerPrice, Length, 0 ) ;
var2 = BollingerBand( BollingerPrice, Length, NumDevsDn ) ;



condition1 = CurrentBar > 1 and TestPriceLBand crosses over var0 and ADX(15) of data2 < ADXNUM;
condition2 = CurrentBar > 1 and (TestPriceLBand crosses under var1);
condition3 = CurrentBar > 1 and TestPriceLBand crosses under var2 and ADX(15) of data2 < ADXNUM;
condition4 = CurrentBar > 1 and (TestPriceLBand crosses over var1 );

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: How to get daily ADX value on 20mins time frame?(MC8.8)

Postby TJ » 05 Jan 2014

Sorry for that.
I am the newbie.
I can't get the correct daily value of ADX on 20 mins time frame.
::
Do you mean you want to have multi-data analysis?

What is your main chart resolution?


You can start here:
post #4 and post #5
viewtopic.php?f=16&t=6929


Return to “MultiCharts”