William Roeder:
What is the first parameter of create?
Thanks William Roeder , and pardon my goofy mistake
I am trying to draw a horizontal line in a separate indicator window , but the lines are being drawn in the main window instead of indicator window
What am i doing wrong ?
my code
double X=1.9498;
ObjectCreate(,"w0",OBJ_HLINE,0, Time[i] ,X );
ObjectSet("w0", OBJPROP_STYLE, 1);
ObjectSet("w0",OBJPROP_WIDTH,2);
ObjectSet("w0", OBJPROP_COLOR, clrNavy);
I am trying to draw a horizontal line in a separate indicator window , but the lines are being drawn in the main window instead of indicator window
What am i doing wrong ?
my code
double X=1.9498;
ObjectCreate(,"w0",OBJ_HLINE,0, Time[i] ,X );
ObjectSet("w0", OBJPROP_STYLE, 1);
ObjectSet("w0",OBJPROP_WIDTH,2);
ObjectSet("w0", OBJPROP_COLOR, clrNavy);
#property indicator_separate_window
checked this line?
I am trying to draw a trend line in a separate indicator window , but the lines are being drawn in the main window instead of indicator window
What am i doing wrong ?
here is my code :
Hi you must use parameter "sub_window"
At your code I see "0". It mean main window. Toi draw line at indocator window you must use number of sub_window your indicator. For this you can use function ChartWindowFind.
#property copyright ""
#property link ""
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 OrangeRed
#property copyright ""
#property link ""
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 OrangeRed
yes
#property copyright "" #property link "" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 OrangeRed extern string Currency = "JPY"; extern string Select1 = "Select USD-EUR-GBP or AUD"; extern string Select2 = "Select CHF-JPY-CAD or NZD"; double EurUsd[],UsdChf[],GbpUsd[],UsdJpy[],AudUsd[],UsdCad[],NzdUsd[]; double Idx[]; int init() { IndicatorShortName("Selected Index ("+Currency+")"); SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Idx); return(0); } void start() { ArrayCopySeries(EurUsd,MODE_CLOSE,"EURUSD"); ArrayCopySeries(GbpUsd,MODE_CLOSE,"GBPUSD"); ArrayCopySeries(AudUsd,MODE_CLOSE,"AUDUSD"); ArrayCopySeries(UsdChf,MODE_CLOSE,"USDCHF"); ArrayCopySeries(UsdJpy,MODE_CLOSE,"USDJPY"); ArrayCopySeries(UsdCad,MODE_CLOSE,"USDCAD"); ArrayCopySeries(NzdUsd,MODE_CLOSE,"NZDUSD"); int counted_bars=IndicatorCounted(); double minArraySize; double USD; minArraySize = MathMin(ArraySize(EurUsd),ArraySize(GbpUsd)); minArraySize = MathMin(ArraySize(AudUsd),minArraySize); minArraySize = MathMin(ArraySize(UsdChf),minArraySize); minArraySize = MathMin(ArraySize(UsdJpy),minArraySize); minArraySize = MathMin(ArraySize(UsdCad),minArraySize); minArraySize = MathMin(ArraySize(NzdUsd),minArraySize); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; limit=MathMin(limit,NormalizeDouble(minArraySize,0)); for(int i=0; i<limit; i++) { USD = MathPow(UsdChf[i]*UsdJpy[i]*UsdCad[i]/EurUsd[i]/GbpUsd[i]/AudUsd[i]/NzdUsd[i],1./8.); if (Currency == "USD_QCW") Idx[i] = USD; if (Currency == "EUR") Idx[i] = USD*EurUsd[i]; if (Currency == "GBP") Idx[i] = USD*GbpUsd[i]; if (Currency == "AUD") Idx[i] = USD*AudUsd[i]; if (Currency == "CHF") Idx[i] = USD/UsdChf[i]; if (Currency == "JPY") Idx[i] = 1/USD*UsdJpy[i]; if (Currency == "CAD") Idx[i] = USD/UsdCad[i]; if (Currency == "NZD") Idx[i] = USD*NzdUsd[i]; } double X=1.9498; ObjectCreate(0,"w0",OBJ_HLINE,0,0,X ); ObjectSet("w0", OBJPROP_STYLE, 1); ObjectSet("w0",OBJPROP_WIDTH,2); ObjectSet("w0", OBJPROP_COLOR, clrNavy); }this is what the whole code looks like, can't you fix it? thank you very much
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to draw a trend line in a separate indicator window , but the lines are being drawn in the main window instead of indicator window
What am i doing wrong ?
here is my code :