Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- void doArrayResizeAndFillDouble(double &array[],int index,double value)
- {
- int indexIncrement=index+1;
- ArrayResize(array,indexIncrement,1000);
- array[index]=value;
- //Alert("array[index]=value : ",array[index]=value);
- }
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- void doArrayResizeAndFillDate(datetime &array[],int index,datetime value)
- {
- int indexIncrement=index+1;
- ArrayResize(array,indexIncrement,1000);
- array[index]=value;
- }
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- void doArrayResizeAndFillString(string &array[],int index,string value)
- {
- int indexIncrement=index+1;
- ArrayResize(array,indexIncrement,1000);
- array[index]=value;
- }
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- void doArrayResizeAndFillInt(int &array[],int index,int value)
- {
- int indexIncrement=index+1;
- ArrayResize(array,indexIncrement,1000);
- array[index]=value;
- }
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- bool doZigZagPoints() // Visszaadja a két utolsó ZigZag pontot.
- {
- int ZigZagPointCount=0;
- bool HaveWeEnoughtZigZagPoints=false;
- for(int a=0; a<History; a=a+1) // Ciklus ami adatokat gyűjt a gyertyákból.
- {
- double ZigZag=iCustom(NULL,0,"ZigZag",6,5,3,0,a); // Az a változó helyén a ciklus léptetője van. (Loop counter)
- if(ZigZag!=0) // Ha nem 0 az értéke akkor egy új pont.
- {
- doArrayResizeAndFillDouble(ZigZagPoints,ZigZagPointCount,ZigZag);
- doArrayResizeAndFillDate(ZigZagPointsTime,ZigZagPointCount,Time[a]);
- ZigZagPointCount++;
- }
- }
- if(ZigZagPointCount<=1) // Ha nincs legalább két pontunk, akkor semmit se csinálunk. Mert 2 pont kell a differencia számitáshoz.
- {
- HaveWeEnoughtZigZagPoints=false;
- }
- else
- {
- T0 = ZigZagPoints[0];
- T1 = ZigZagPoints[1];
- T0D = ZigZagPointsTime[0]; // Külön tömben van a pont dátuma és a pont értéke. OOP vel is megoldható, de bonyolitaná.
- T1D = ZigZagPointsTime[1];
- HaveWeEnoughtZigZagPoints=true;
- }
- return HaveWeEnoughtZigZagPoints;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement