Draw Line on Array & MathPow

To add comments, please log in or register
Panjianom Adi Pratomo
Panjianom Adi Pratomo  

Hi All,

Can anybody help me please?
I have been trying to draw lines in an array that is in a sequence of square the array by using MathPow.
This code only drawn 1 horizontal line only and without drawn fibonacci line:

This how far have gone:

#property strict
#property show_inputs
#property indicator_chart_window
#define  NL    "\n"

extern color LineColor=Green;
extern int LineWidth=1;

int init()

int deinit()
  Comment ("");

int start()
  double ArraySquare[];
  int Limit=40;
  int priceindex;
  int y=2;

  for(int i=1; i<Limit; i++)
    ArrayResize(ArraySquare, Limit, 0);
    ArraySquare[i] = MathPow(i, y);
    priceindex = ArraySquare[i];


    Comment(i, " ^ ", y, " = ", priceindex);
    Print(i, " ^ ",  y, " = ", priceindex);


void DrawLine(double priceindex)
  ObjectCreate("Line", OBJ_HLINE, 0, 0, priceindex);
  ObjectSet("Line", OBJPROP_STYLE, LineStyle);
  ObjectSet("Line", OBJPROP_COLOR, LineColor);
  ObjectSet("Line", OBJPROP_WIDTH, LineWidth);

void DrawFibo(double priceindex)
  ObjectSetFiboDescription("FiboLine",0,"0/2 @%$");
  ObjectSetFiboDescription("FiboLine",1,"1/2 @%$");
  ObjectSetFiboDescription("FiboLine",2,"2/2 @%$");

Any suggestions would be welcome. Thanks in advanced.

To add comments, please log in or register