loop all symbol in Tock()

Posted By: Grat

loop all symbol in Tock() - 05/05/21 18:32

Hi,

I have someone like this:

Code
int run(){
..
..
    while(asset(loop(SYMBOLS))){
        if(!is(LOOKBACK)){
            TockTime=1000;
..
}


how to realise int the tock() fce will be call every symbols? This construction don't work:

Code
void tock(){
    int nShift=0;
    bool lFinish=true;
    char *cSymbol = malloc(6*sizeof(char));
    while(asset(loop(SYMBOLS))){
...


from the manual:
Within a tick function the asset name, the current ask price, and the current ask-bid spread can be evaluated with the Asset string, with priceClose(0), and with the Spread variable. The time stamp of the last quote is returned by seconds(0) or wdate(0). For evaluating component specific parameters such trade statistics, call asset(Asset) and/or algo(...) at the begin of the tick function.
Posted By: Grat

Re: loop all symbol in Tock() - 05/05/21 19:19

I try this symbol:

#define SYMBOLS "EUR/USD","USD/JPY","EUR/JPY","AUD/USD","NZD/USD","AUD/NZD","USD/CAD","GBP/USD","EUR/GBP","GBP/JPY","AUD/JPY","EUR/CAD"

and in the tock() is only last "EUR/CAD". In the print, I don't se other symbol.

My question - how to set all Assets like programers - now I see only one:

void tock()
Asset(ASSET1);
..
Asset(ASSET2);
..
..
Asset(ASSETn);

frown
© 2024 lite-C Forums