Data2

Questions about MultiCharts and user contributed studies.
Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Data2

Postby Jonny473 » 04 Nov 2019

Hi there I am having the data2 problem again. I know TJ advised how to handle it here (5):
viewtopic.php?f=16&t=6929

But still not working. Here is the indicator I am using with datafeed 1 and 2. Dont worry about the formulas and data1 (as data1 can be every TF as long as< then data2).

So basically everything you see in here shall reference to data2. Also please be advised that I am using ADE to gather OHLCV Daily data from another symbol for one condition. I know its wotking if there is just data1:

Code: Select all

inputs:
Coef( .2 ),
VCoef( 2.5 ),
VFIPeriod( 130 ),
VFISmoothedPeriod( 3 ),
MA100Length( 100 ),
Trigger(3),
low_(5),
RSI_Up(70),
Trailpoints(5),
D1( 3 ),{DAYS FOR RS Moving Average}
Per1(3),Per2(8),Off1(0),Off2(2),
RSI_(30),
MA_neu(200),g(2),
Rsi_Length(14),
MAD( 100 ), //DAYS FOR MA
TRD(60), //DAYS FOR TREND
XMA(3),
Tage_(63),
Stoploss_(0.04),
Interval(ADE.Daily), // number of minutes, or ADE.Daily, ADE.Weekly, ADE.Monthly
UseFile(ADE.UseFile);

variables:
oCutOff( 0,data2),
oVC( 0,data2 ),
oMF( 0,data2 ),
oVFI( 0,data2 ),
VFI( 0,data2 ),
MyVolume_( 0,data2 ),
MA100Value( 0,data2 ),
Stiffness( 0,data2 ),
MktTrendAvgVal( 0,data2 ),
Cond1( 0,data2 ),
Cond2( 0,data2 ),
Cond3( 0,data2 ),
Cond4( 0,data2 ),
Cond5( 0,data2 ),
Cond6( 0,data2 ),
Cond7( 0,data2),
Cond8( 0,data2 ),
Cond9( 0,data2 ),
Cond10( 0,data2 ),
Cond11( 0,data2 ),
Cond1Weight( 0,data2 ),
Cond2Weight( 0,data2 ),
Cond3Weight( 0,data2 ),
Cond4Weight( 0 ,data2),
Cond5Weight( 0,data2 ),
Cond6Weight( 0,data2 ),
Cond7Weight( 0,data2 ),
Cond8Weight( 0,data2 ),
Cond9Weight( 0,data2 ),
Cond10Weight( 0,data2 ),
Cond11Weight( 0,data2 ),
Count(0,data2),
Condition_neu1(0,data2),
ConditionSum_Trigger( 0,data2 ),
ConditionSumBasis(0,data2),
ConditionSumGesamt(0,data2),
ConditionSum_( 0,data2 ),
Condition_neu(false,data2),
dir(0,data2),
Lin(0,data2),
upCount(false),
IM(0,data2),INTERMARKETRS(0,data2),
Differenz(0,data2),
hh1(0,data2),
hh2(0,data2),
ll1(0,data2),
ll2(0,data2),
line1(0,data2),
line2(0,data2),
MA(0,data2),
CLMA(0,data2),
PERS(0,data2),
Close2(0,data2),
High2(0,data2),
Low2(0,data2),
Volume2(0,data2),
Class("OHLCV"),
InfoMap(MapSN.New),
Index(0),
PrevIndex(0),
MyOpen(0),
MyHigh(0),
MyLow(0),
MyClose(0),
MyVolume(0);

if CurrentBar = 1 and UseFile then
Value1 = ADE.OpenMap(Class, GetSymbolName, Interval);

// Retrieve the OHLCV data for this symbol and bar interval.
PrevIndex = Index;
Index = ADE.GetOHLCV("SPY", Interval, ADE.BarID, MyOpen, MyHigh, MyLow, MyClose, MyVolume);

Close2=Close data2;
High2=High data2;
Low2=Low data2;
Volume2=Volume data2;



MA=AVERAGE(Close2,MAD)data2- .2 *StdDev( Close2, MAD )data2 ;
CLMA=IFF(Close2<MA,1,0)data2;
PERS=CLMA+TRD;
STIFFNESS=(TRD-PERS)*100/TRD;


hh1 = Highest(High2, Per1)data2 + Off1 * Tick;
ll1 = Lowest(Low2, Per1)data2 - Off1 * Tick;
hh2 = Highest(High2, Per2)data2 + Off2 * Tick;
ll2 = Lowest(Low2, Per2)data2 - Off2 * Tick;

If Close2 > line1[1] then
line1 = ll1
else
line1 = hh1;

If Close2 > line2[1] then
line2 = ll2
else
line2 = hh2;

If Close2 > line1 and Close2 > line2 then begin
dir = 1;
end else If Close2 < line1 and Close2 < line2 then begin
dir = -1;
end;



MyVolume_ = iff( BarType < 2, Ticks, Volume2 )data2;
VFI = VFISmooth(Coef, VCoef, VFIPeriod, VFISmoothedPeriod,
MyVolume_, oCutOff, oVC, oMF, oVFI )data2 ;
if VFI > 0 then
Cond1 = Cond1Weight
else
Cond1 = 0 ;

// Calculate MA100
// For Conditions 2 and 3
MA100Value = Average( Close2, MA100Length )data2 ;
if Close > MA100Value then
Cond2 = Cond2Weight
else
Cond2 = 0 ;

if MA100Value >= MA100Value[3] and MA100Value >= MA100Value[4] and MA100Value >= MA100Value[5] then
Cond3 = Cond3Weight
else
Cond3 = 0 ;

// Calculate Stiffness for Cond4
Stiffness = Countif( Close2 < MA100Value, 63 )data2 ;
if Stiffness < 7 then
Cond4 = Cond4Weight
else
Cond4 = 0 ;


INTERMARKETRS=XAVERAGE(Close2/MyClose,3)data2;

if INTERMARKETRS> Average(INTERMARKETRS,D1) and (INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS>INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) or
(INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS<INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) then
Cond5 = Cond5Weight
else
Cond5 = 0 ;

if low<lowest(Close2,low_)data2 then
Cond6 = Cond6Weight
else
Cond6 = 0 ;


if RSI(Close2,Rsi_Length)data2<RSI_Up then
Cond7 = Cond7Weight
else
Cond7 = 0 ;


if MyClose[1]>Average(MyClose,200) and MyClose[2]>Average(MyClose,200) and MyClose[3]>Average(MyClose,200)
and MyClose[6] >Average(MyClose,200) then
Cond8 = Cond8Weight
else
Cond8 = 0 ;

if dir = 1 then
Cond9 = Cond9Weight
else
Cond9 = 0 ;



ConditionSumBasis=Cond6 + Cond7 + Cond8 + Cond9 ;
ConditionSumGesamt=ConditionSumBasis+ConditionSum_Trigger;
ConditionSum_=Cond10+Cond11;
Lin=7;

if RSI(Close2,Rsi_Length)data2>RSI_Up then
Cond11 = Cond11Weight
else
Cond11 = 0 ;
ConditionSum_Trigger = Cond1 + Cond2 + Cond3 + Cond4 + Cond5;
If ConditionSum_Trigger=4 and ConditionSumBasis=4 then begin upCount = true;
end;
If RSI(Close2,Rsi_Length)data2>RSI_Up or (close2>close2[count] and dir=-1) or count>99 or close2[count]<close2-(close2*Stoploss_)then upCount = false;
If upCount = false then count=0;
if upCount = true then begin
count = count + 1;
end;


Plot3(Count, "Counter" ) ;

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

Re: Data2

Postby TJ » 04 Nov 2019

What are the data series resolutions? including the ADE chart?

Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Re: Data2

Postby Jonny473 » 04 Nov 2019

Data series 2 and ADE Chart are Daily. Data 1 can be whatever, just should be smaller than data2.

Zheka
Posts: 223
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 53 times

Re: Data2

Postby Zheka » 04 Nov 2019

As the first step, try changing function calls from:

Code: Select all

MA100Value = Average( Close2, MA100Length )data2 ;
to:

Code: Select all

MA100Value = Average( Close, MA100Length) data(2) ;

Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Re: Data2

Postby Jonny473 » 04 Nov 2019

Alright will do so. What about the Close2? I defined it as a variable as you mentioned it in one of your posts.

Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Re: Data2

Postby Jonny473 » 04 Nov 2019

Ok here is the current code. Still not really doing what it is supposed to:

Code: Select all

inputs:
Coef( .2 ),
VCoef( 2.5 ),
VFIPeriod( 130 ),
VFISmoothedPeriod( 3 ),
MA100Length( 100 ),
Trigger(3),
low_(5),
RSI_Up(70),
Trailpoints(5),
MarketTrendSymbol( "SPY" ),
D1( 3 ),{DAYS FOR RS Moving Average}
Per1(3),Per2(8),Off1(0),Off2(2),
RSI_(30),
MA_neu(200),g(2),
Rsi_Length(14),
MAD( 100 ), //DAYS FOR MA
TRD(60), //DAYS FOR TREND
XMA(3),
Tage_(63),
Stoploss_(0.04),
Interval(ADE.Daily), // number of minutes, or ADE.Daily, ADE.Weekly, ADE.Monthly
UseFile(ADE.UseFile);

variables:
oCutOff( 0, data2),
oVC( 0, data2),
oMF( 0, data2),
oVFI( 0, data2),
VFI( 0, data2),
MyVolume_( 0, data2),
MA100Value( 0, data2),
Stiffness( 3, data2),
MktTrendAvgVal( 0, data2),
Cond1( 0, data2),
Cond2( 0, data2),
Cond3( 0, data2),
Cond4( 0, data2),
Cond5( 0, data2),
Cond6( 0, data2),
Cond7( 0, data2),
Cond8( 0, data2),
Cond9( 0, data2),
Cond10( 0, data2),
Cond11( 0, data2),
Cond1Weight( 1, data2),
Cond2Weight( 1, data2),
Cond3Weight( 1, data2),
Cond4Weight( 1, data2),
Cond5Weight( 2, data2 ),
Cond6Weight( 1, data2),
Cond7Weight( 1, data2),
Cond8Weight( 1, data2),
Cond9Weight( 1, data2),
Cond10Weight( 1, data2),
Cond11Weight( 1, data2),
Count( 0, data2),
Condition_neu1( 0, data2),
ConditionSum_Trigger( 0, data2),
ConditionSumBasis( 0, data2),
ConditionSumGesamt( 0, data2),
ConditionSum_( 0, data2),
Condition_neu(false,data2),
dir( 0, data2),
Lin( 0, data2),
upCount(false, data2),
INTERMARKETRS( 0, data2),
Differenz( 0, data2),
hh1( 0, data2),
hh2( 0, data2),
ll1( 0, data2),
ll2( 0, data2),
line1( 0, data2),
line2( 0, data2),
MA( 0, data2),
CLMA( 0, data2),
PERS( 0, data2),
Class("OHLCV"),
InfoMap(MapSN.New),
Index(0),
PrevIndex(0),
MyOpen(0),
MyHigh(0),
MyLow(0),
MyClose(0),
MyVolume(0);


if CurrentBar = 1 and UseFile then
Value1 = ADE.OpenMap(Class, GetSymbolName, Interval);

// Retrieve the OHLCV data for this symbol and bar interval.
PrevIndex = Index;
Index = ADE.GetOHLCV("SPY", Interval, ADE.BarID, MyOpen, MyHigh, MyLow, MyClose, MyVolume);


MA=AVERAGE(C,MAD) data(2)- .2 *StdDev( Close, MAD )data(2) ;
CLMA=IFF(C<MA,1,0)data(2);
PERS=CLMA+TRD;
STIFFNESS=(TRD-PERS)*100/TRD;


hh1 = Highest(High, Per1)data(2) + Off1 * Tick;
ll1 = Lowest(Low, Per1)data(2) - Off1 * Tick;
hh2 = Highest(High, Per2)data(2) + Off2 * Tick;
ll2 = Lowest(Low, Per2)data(2) - Off2 * Tick;

If Close > line1[1] then
line1 = ll1
else
line1 = hh1;

If Close > line2[1] then
line2 = ll2
else
line2 = hh2;

If Close > line1 and Close > line2 then begin
dir = 1;
end else If Close < line1 and Close < line2 then begin
dir = -1;
end;






// Calculate VFI
// For Condition 1
// See TASC JUN 2004 for this
// author's discussion of VFI
MyVolume_ = iff( BarType < 2, Ticks, Volume )data(2);
VFI = VFISmooth(Coef, VCoef, VFIPeriod, VFISmoothedPeriod,
MyVolume_, oCutOff, oVC, oMF, oVFI )data(2) ;
if VFI > 0 then
Cond1 = Cond1Weight
else
Cond1 = 0 ;

// Calculate MA100
// For Conditions 2 and 3
MA100Value = Average( Close, MA100Length ) data(2) ;
if Close > MA100Value then
Cond2 = Cond2Weight
else
Cond2 = 0 ;

if MA100Value >= MA100Value[3] and MA100Value >= MA100Value[4] and MA100Value >= MA100Value[5] then
Cond3 = Cond3Weight
else
Cond3 = 0 ;

// Calculate Stiffness for Cond4
Stiffness = Countif( Close < MA100Value, 63 ) data(2);
if Stiffness < 7 then
Cond4 = Cond4Weight
else
Cond4 = 0 ;

// Calculate Rel. Strenght
INTERMARKETRS=XAVERAGE(C/MyClose,3);

if INTERMARKETRS> Average(INTERMARKETRS,D1) and (INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS>INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) or
(INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS<INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) then
Cond5 = Cond5Weight
else
Cond5 = 0 ;

if low<lowest(Close,low_) then
Cond6 = Cond6Weight
else
Cond6 = 0 ;


if RSI(Close,Rsi_Length)<RSI_Up data(2) then
Cond7 = Cond7Weight
else
Cond7 = 0 ;


if MyClose[1]>Average(MyClose,200) and MyClose[2]>Average(MyClose,200) and MyClose[3]>Average(MyClose,200)
and MyClose[6] >Average(MyClose,200) then
Cond8 = Cond8Weight
else
Cond8 = 0 ;

if dir = 1 data(2) then
Cond9 = Cond9Weight
else
Cond9 = 0 ;



ConditionSumBasis=Cond6 + Cond7 + Cond8 + Cond9 ;



ConditionSum_Trigger = Cond1 + Cond2 + Cond3 + Cond4 + Cond5;
If ConditionSum_Trigger>Trigger and ConditionSumBasis=4 then begin upCount = true;
end;
If RSI(Close,Rsi_Length)>RSI_Up data(2) or (close>close[count]data(2) and dir=-1 data(2)) or count>99 data(2) or close[count]<close-(close*Stoploss_)data(2) then upCount = false;
If upCount = false then count=0 data(2);
if upCount = true then begin
count = count + 1;
end;



Plot3(Count, "Counter" );

Zheka
Posts: 223
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 53 times

Re: Data2

Postby Zheka » 04 Nov 2019

What does that suppose to mean?

Code: Select all

RSI_Up data(2)
or

Code: Select all

dir=-1 data(2)
If you want to call a function on data2, then the syntax is f() data(2) (and it will take input parameters from data2 -so no need to pass Close2).
If you want to use a variable, changing its value only on each bar of data2, then you declare such a variable as Var1(0,data2) (as you did)

Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Re: Data2

Postby Jonny473 » 04 Nov 2019

RSI(Close,Rsi_Length)<RSI_Up data(2)...means that the Close shall reference to data 2, same fot the second example.

Applying it to a Daily chart (without data2) and applying it to the same symbol data1 15 Min data2 Daily, this only referencing to data (as laid out in the code) should give me the same result. Thats not the case. Maybe becuase

Zheka
Posts: 223
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 53 times

Re: Data2

Postby Zheka » 04 Nov 2019

RSI(Close,Rsi_Length) data(2) <RSI_Up

Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Re: Data2

Postby Jonny473 » 04 Nov 2019

Thanks will amend and inform about the result.

Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Re: Data2

Postby Jonny473 » 04 Nov 2019

RSI(Close,Rsi_Length) data(2) <RSI_Up
That solved the problem. Now one more thing. if I want call the "SPY" Daily Closes not from ADE bur from data3, how do I do it:

Code: Select all

inputs:
Coef( .2 ),
VCoef( 2.5 ),
VFIPeriod( 130 ),
VFISmoothedPeriod( 3 ),
MA100Length( 100 ),
Trigger(3),
low_(5),
RSI_Up(70),
Trailpoints(5),
D1( 3 ),{DAYS FOR RS Moving Average}
Per1(3),Per2(8),Off1(0),Off2(2),
RSI_(30),
MA_neu(200),g(2),
Rsi_Length(14),
MAD( 100 ), //DAYS FOR MA
TRD(60), //DAYS FOR TREND
XMA(3),
Tage_(63),
Stoploss_(0.04),

variables:
oCutOff( 0, data2),
oVC( 0, data2),
oMF( 0, data2),
oVFI( 0, data2),
VFI( 0, data2),
MyVolume_( 0, data2),
MA100Value( 0, data2),
Stiffness( 3, data2),
MktTrendAvgVal( 0, data2),
Cond1( 0, data2),
Cond2( 0, data2),
Cond3( 0, data2),
Cond4( 0, data2),
Cond5( 0, data2),
Cond6( 0, data2),
Cond7( 0, data2),
Cond8( 0, data2),
Cond9( 0, data2),
Cond10( 0, data2),
Cond11( 0, data2),
Cond1Weight( 1, data2),
Cond2Weight( 1, data2),
Cond3Weight( 1, data2),
Cond4Weight( 1, data2),
Cond5Weight( 2, data2 ),
Cond6Weight( 1, data2),
Cond7Weight( 1, data2),
Cond8Weight( 1, data2),
Cond9Weight( 1, data2),
Cond10Weight( 1, data2),
Cond11Weight( 1, data2),
Count( 0, data2),
Condition_neu1( 0, data2),
ConditionSum_Trigger( 0, data2),
ConditionSumBasis( 0, data2),
ConditionSumGesamt( 0, data2),
ConditionSum_( 0, data2),
Condition_neu(false,data2),
dir( 0, data2),
Lin( 0, data2),
upCount(false, data2),
INTERMARKETRS( 0, data2),
Differenz( 0, data2),
hh1( 0, data2),
hh2( 0, data2),
ll1( 0, data2),
ll2( 0, data2),
line1( 0, data2),
line2( 0, data2),
MA( 0, data2),
CLMA( 0, data2),
PERS( 0, data2),
MyOpen(0,DATA3),
MyHigh(0,DATA3),
MyLow(0,DATA3),
MyClose(0,DATA3),
MyVolume(0,DATA3);



MA=AVERAGE(C,MAD) data(2)- .2 *StdDev( Close, MAD )data(2) ;
CLMA=IFF(C<MA,1,0)data(2);
PERS=CLMA+TRD;
STIFFNESS=(TRD-PERS)*100/TRD;


hh1 = Highest(High, Per1)data(2) + Off1 * Tick;
ll1 = Lowest(Low, Per1)data(2) - Off1 * Tick;
hh2 = Highest(High, Per2)data(2) + Off2 * Tick;
ll2 = Lowest(Low, Per2)data(2) - Off2 * Tick;

If Close data(2) > line1[1] then
line1 = ll1
else
line1 = hh1;

If Close data(2) > line2[1] then
line2 = ll2
else
line2 = hh2;

If Close data(2) > line1 and Close data(2) > line2 then begin
dir = 1;
end else If Close data(2)< line1 and Close data(2)< line2 then begin
dir = -1;
end;






MyVolume_ = iff( BarType < 2, Ticks, Volume )data(2);
VFI = VFISmooth(Coef, VCoef, VFIPeriod, VFISmoothedPeriod,
MyVolume_, oCutOff, oVC, oMF, oVFI )data(2) ;
if VFI > 0 then
Cond1 = Cond1Weight
else
Cond1 = 0 ;

// Calculate MA100
// For Conditions 2 and 3
MA100Value = Average( Close, MA100Length ) data(2) ;
if Close > MA100Value then
Cond2 = Cond2Weight
else
Cond2 = 0 ;

if MA100Value >= MA100Value[3] and MA100Value >= MA100Value[4] and MA100Value >= MA100Value[5] then
Cond3 = Cond3Weight
else
Cond3 = 0 ;

// Calculate Stiffness for Cond4
Stiffness = Countif( Close < MA100Value, 63 ) data(2);
if Stiffness < 7 then
Cond4 = Cond4Weight
else
Cond4 = 0 ;

// Calculate Rel. Strenght
INTERMARKETRS=XAVERAGE(Close data2/MyClose,3);

if INTERMARKETRS> Average(INTERMARKETRS,D1) and (INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS>INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) or
(INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS<INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) then
Cond5 = Cond5Weight
else
Cond5 = 0 ;

if low data(2)<lowest(Close,low_)data(2) then
Cond6 = Cond6Weight
else
Cond6 = 0 ;


if RSI(Close,Rsi_Length)data(2)<RSI_Up then
Cond7 = Cond7Weight
else
Cond7 = 0 ;


if MyClose[1]>Average(MyClose,200)data(3) and MyClose[2]>Average(MyClose,200)data(3) and MyClose[3]>Average(MyClose,200)data(3)
and MyClose[6]>Average(MyClose,200)data(3) then
Cond8 = Cond8Weight
else
Cond8 = 0 ;

if dir = 1 data(2) then
Cond9 = Cond9Weight
else
Cond9 = 0 ;



ConditionSumBasis=Cond6 + Cond7 + Cond8 + Cond9 ;



ConditionSum_Trigger = Cond1 + Cond2 + Cond3 + Cond4 + Cond5;
If ConditionSum_Trigger>Trigger and ConditionSumBasis=4 then begin upCount = true;
end;
If RSI(Close,Rsi_Length)data(2)>RSI_Up or (close>close[count]data(2) and dir data(2)=-1 ) or count data(2)>99 or close[count data(2)]<close-(close*Stoploss_)data(2) then upCount = false;
If upCount = false then count=0 data(2);
if upCount = true then begin
count = count + 1;
end;

If count>0 then buy 1 contract this bar close;
If count<1 then sell 1 contract this bar close;
Basically its just condition 5 & 8 thats referring to SPY data3...can you also helpe here?

Zheka
Posts: 223
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 53 times

Re: Data2

Postby Zheka » 04 Nov 2019

You only corrected RSI, need to do the same in all similar cases.
Accessing data3 is no different than data2.

Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Re: Data2

Postby Jonny473 » 05 Nov 2019

For data3 you mean?
For data3 in this case I defined MyClose in the variables MyClose(0,data3) and later as MyClose=Close of data3;
For condition 5 and 8 (only two conditions where data3 is needed):

Condition5:

Code: Select all

INTERMARKETRS=XAVERAGE(Close data(2)/MyClose,3);

if INTERMARKETRS> Average(INTERMARKETRS,D1) and (INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS>INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) or
(INTERMARKETRS>INTERMARKETRS[1] and INTERMARKETRS<INTERMARKETRS[2]and INTERMARKETRS>INTERMARKETRS[3]) then
Cond5 = Cond5Weight
else
Cond5 = 0 ;
Here it gets a little bit tricky as both data2 and data3 are used.




Condition8:

Code: Select all

if MyClose[1]>Average(MyClose,200) and MyClose[2]>Average(MyClose,200) and MyClose[3]>Average(MyClose,200)and MyClose[6]>Average(MyClose,200) then
Cond8 = Cond8Weight
else
Cond8 = 0 ;
Any suggestions?


Return to “MultiCharts”