Hi,
This is the full subset code of DeMark Trendline Trader. I want to capture the estimate of the High and Low profit zones in a buffer for external use. In the code I have already set the Array: double ExtBufferLow []; and SetIndexBuffer(3,ExtBufferLow);
I have highlighted below how the value is assigned to the array, but this does not work - but why ?
This is the full subset code of DeMark Trendline Trader. I want to capture the estimate of the High and Low profit zones in a buffer for external use. In the code I have already set the Array: double ExtBufferLow []; and SetIndexBuffer(3,ExtBufferLow);
I have highlighted below how the value is assigned to the array, but this does not work - but why ?
Inserted Code
string TakeProfitLowTD(int L1,int L2,int Step,int Col)/*Draw Sell TD Price Projection(s)*/
{
int i,ii,j=0;
string Comm="";
double kL,LC1,LC2,LC3,k,St;
kL=(Low[L1]-Low[L2])/(L2-L1);
while (NormalizeDouble(Point,j)==0)j++;
k=0;
for(i=L1;i>0;i--)if(Close[i]<Low[L2]+kL*(L2-i)){k=Low[L2]+kL*(L2-i);break;}
if (k>0)
{
Comm=Comm+"LTD_Line ("+DoubleToStr(Low[L2]+kL*L2,j)+") broken at "+DoubleToStr(k,j)+", downtargets:\n";
ii=Highest(NULL,0,MODE_HIGH,L2-i,i);
LC1=High[ii]-(Low[L2]+kL*(L2-ii));
LC2=Close[ii]-(Low[L2]+kL*(L2-ii));
i=Highest(NULL,0,MODE_CLOSE,L2-i,i);
LC3=Close[ii]-(Low[L2]+kL*(L2-ii));
St=TrendLineStyle;/*Original STYLE_SOLID*/
}
else
{
k=Low[L2]+kL*L2;
Comm=Comm+"LTD_Line ("+DoubleToStr(k,j)+"), probable downbreak targets:\n";
ii=Highest(NULL,0,MODE_HIGH,L2,0);
LC1=High[ii]-(Low[L2]+kL*(L2-ii));
LC2=Close[ii]-(Low[L2]+kL*(L2-ii));
ii=Highest(NULL,0,MODE_CLOSE,L2,0);
LC3=Close[ii]-(Low[L2]+kL*(L2-ii));
St=TrendLineStyle;/*Original STYLE_DASHDOT*/
}
ObjectSet("LL_"+Step,OBJPROP_STYLE,St);
Comm=Comm+"T1="+DoubleToStr(k-LC1,j)+" ("+DoubleToStr(LC1/Point,0)+"pts.)\n";//changed "pts.)" to "pts.)\n"
********************************
ExtBufferLow [1] = (k-LC1) ; //here is where the value will not set onto the array ????****************************
********************************
//Comm=Comm+" T2="+DoubleToStr(k-LC2,j)+" ("+DoubleToStr(LC2/Point,0)+"pts.)";
//Comm=Comm+" T3="+DoubleToStr(k-LC3,j)+" ("+DoubleToStr(LC3/Point,0)+"pts.)\n";
ObjectSet("LC1_"+Step,OBJPROP_TIME1,Time[L1]);ObjectSet("LC1_"+Step,OBJPROP_TIME2,Time[0]);
ObjectSet("LC1_"+Step,OBJPROP_PRICE1,k-LC1);ObjectSet("LC1_"+Step,OBJPROP_PRICE2,k-LC1);
ObjectSet("LC1_"+Step,OBJPROP_COLOR,Col);ObjectSet("LC1_"+Step,OBJPROP_STYLE,St);
//ObjectSet("LC2_"+Step,OBJPROP_TIME1,Time[L1]);ObjectSet("LC2_"+Step,OBJPROP_TIME2,Time[0]);
//ObjectSet("LC2_"+Step,OBJPROP_PRICE1,k-LC2);ObjectSet("LC2_"+Step,OBJPROP_PRICE2,k-LC2);
//ObjectSet("LC2_"+Step,OBJPROP_COLOR,Col);ObjectSet("LC2_"+Step,OBJPROP_STYLE,St);
//ObjectSet("LC3_"+Step,OBJPROP_TIME1,Time[L1]);ObjectSet("LC3_"+Step,OBJPROP_TIME2,Time[0]);
//ObjectSet("LC3_"+Step,OBJPROP_PRICE1,k-LC3);ObjectSet("LC3_"+Step,OBJPROP_PRICE2,k-LC3);
//ObjectSet("LC3_"+Step,OBJPROP_COLOR,Col);ObjectSet("LC3_"+Step,OBJPROP_STYLE,St);
if (Step==1)
{
ObjectSet("LC1_"+Step,OBJPROP_WIDTH,ProjectionLinesWidth);/*Original OBJPROP_WIDTH,2*/
ObjectSet("LC1_"+Step,OBJPROP_STYLE,ProjectionLinesStyle);/*This Line of code added from original. TD Lower Projection Line Style*/
//ObjectSet("LC2_"+Step,OBJPROP_WIDTH,2);
//ObjectSet("LC3_"+Step,OBJPROP_WIDTH,2);
}
else
{
ObjectSet("LC1_"+Step,OBJPROP_WIDTH,2);
//ObjectSet("LC2_"+Step,OBJPROP_WIDTH,2);
//ObjectSet("LC3_"+Step,OBJPROP_WIDTH,2);
}
return(Comm);
}