Topics
03 Apr 2015, 15:01
 3877
 9
29 Mar 2015, 14:12
 3804
 5
Replies

hq76
07 Apr 2015, 17:43

Found this in the donchian channels indicators  /algos/indicators/show/133:

private double Highest(DataSeries arr,int range,int fromIndex)
        {
            double res;
            int i;
            res=arr[fromIndex];
            for(i=fromIndex;i>fromIndex-range && i>=0;i--)
            {
                if(res<arr[i]) res=arr[i];
            }
            return(res);
        }
 
        private double Lowest(DataSeries arr,int range,int fromIndex)
        {
            double res;
            int i;
            res=arr[fromIndex];
            for(i=fromIndex;i>fromIndex-range && i>=0;i--)
            {
                if(res>arr[i]) res=arr[i];
            }
            return(res);
        }

Fits my needs, no worries.


@hq76

hq76
07 Apr 2015, 16:33

RE:

Ian_Drummond said:

cAlgo doesn't support multi symbol back testing... There are lots of requests for it so hopefully it is in development...

 

Ok thank you Ian.

Even if the tester cannot trade multiple symbol, can it proceed information from indicators that need many symbols to calculate ? i mean do a multisymbol indicator can be used to achieved trades on a single pair in the tester ? Thanks. 


@hq76

hq76
03 Apr 2015, 22:56

RE:

Manuel_Meza said:

Con un loop, que compare cada elemento del array con todos, si en la comparacion, el nuevo es el mas grande, toma ese valor... sino, el que tienes es el valor mas grande.

Gracias Manuel. Pienso tambien already. Thought it would have a cAlgo function... ?


@hq76

hq76
30 Mar 2015, 21:34

RE: RE: RE:

Invalid said:

"EURUSD".EndsWith("USD")
//and
"USDJPY".StartsWith("USD")

 

Oh thanks a lot, it works. I remembered looking at this function, but it didnt work the first time.


@hq76

hq76
30 Mar 2015, 16:57

RE:

Invalid said:

Compare is used to check if strings are equal.

Use Contains method

Symbol.Code.Contains("EUR");

 

Thank you Invalid. But i still need to check if "EUR" is the base currency or not... I know that EUR are always the base currency in forex pairs though.. But i'll have to check the same way for "USD" for instance.

I would like to check if "USD" is the 1st currency in "USDJPY" or the second one in "GBPUSD".

 


@hq76