See post #2.
I can get the angles drawn, but for some reason, I can't pull any values from the objects except for ones I set.
I can get the angles drawn, but for some reason, I can't pull any values from the objects except for ones I set.
Trendline Angles 0 replies
Angles & Separation Systems 0 replies
Now you see it, ... Now you don't 2 replies
Gain Capital now has trailing stops 4 replies
Calculating Angles 3 replies
#property copyright "Copyright © 2010, Nondisclosure007"
#property link "[url]http://no.link.yet[/url]"
#property indicator_chart_window
#property indicator_buffers 2
double floor[];
double ceiling[];
int init()
{
IndicatorBuffers(2);
IndicatorDigits(Digits);
SetIndexBuffer(0,floor);
SetIndexLabel(0,"Lower Angle");
SetIndexBuffer(1,ceiling);
SetIndexLabel(1,"Upper Angle");
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
ArraySetAsSeries(floor,true);
ArraySetAsSeries(ceiling,true);
return(0);
}
int deinit()
{
ObjectDelete("LowerAngle");ObjectDelete("UpperAngle");
return(0);
}
int start()
{
int i, k, limit, counted_bars=IndicatorCounted();
limit = Bars-counted_bars-1;
double varLowMACurrent, varLowMALast, varHighMALast, varHighMACurrent;
datetime varTime;
for(i=limit; i>=0; i--)
{
varLowMACurrent=iMA(NULL,0,34,0,MODE_EMA,PRICE_LOW,i+1);
varLowMALast=iMA(NULL,0,34,0,MODE_EMA,PRICE_LOW,i+2);
varHighMACurrent=iMA(NULL,0,34,0,MODE_EMA,PRICE_HIGH,i+1);
varHighMALast=iMA(NULL,0,34,0,MODE_EMA,PRICE_HIGH,i+2);
if (ObjectFind("LowerAngle")==-1)
{ObjectCreate("LowerAngle",OBJ_TRENDBYANGLE,0,Time[i+2],varLowMALast,Time[i+1],varLowMACurrent);}
ObjectSet("LowerAngle",OBJPROP_STYLE,STYLE_DOT);
ObjectSet("LowerAngle",OBJPROP_TIME1,Time[i+2]);
ObjectSet("LowerAngle",OBJPROP_TIME2,Time[i+1]);
ObjectSet("LowerAngle",OBJPROP_PRICE1,varLowMALast);
ObjectSet("LowerAngle",OBJPROP_PRICE2,varLowMACurrent);
ObjectSet("LowerAngle",OBJPROP_COLOR,Magenta);
ObjectSet("LowerAngle",OBJPROP_RAY,true);
floor[i]=ObjectGet("LowerAngle",OBJPROP_ANGLE);
if (ObjectFind("UpperAngle")==-1)
{ObjectCreate("UpperAngle",OBJ_TRENDBYANGLE,0,Time[i+2],varHighMALast,Time[i+1],varHighMACurrent);}
ObjectSet("UpperAngle",OBJPROP_STYLE,STYLE_DOT);
ObjectSet("UpperAngle",OBJPROP_TIME1,Time[i+2]);
ObjectSet("UpperAngle",OBJPROP_TIME2,Time[i+1]);
ObjectSet("UpperAngle",OBJPROP_PRICE1,varHighMALast);
ObjectSet("UpperAngle",OBJPROP_PRICE2,varHighMACurrent);
ObjectSet("UpperAngle",OBJPROP_COLOR,Magenta);
ObjectSet("UpperAngle",OBJPROP_RAY,true);
ceiling[i]=ObjectGet("UpperAngle",OBJPROP_ANGLE);
WindowRedraw();
}
return(0);
}
//+------------------------------------------------------------------+