multiple advise

Posted By: Grat

multiple advise - 01/11/21 09:08

Hi,

do you anybody know, how to:

During the train I get this error:

Error 049: Too many trades per bar (47176 at bar 14008)
Error 111: Crash in run: run() at bar 14008


I try this:
LifeTime = 2;
MaxLong = MaxShort = -1; // only 1 open trade


but no change - still is a error 049

my code...
Code

void runAdvise(int ii){
        
    vLong12[ii] = adviseLong(PATTERN+FAST+RETURNS,0,
        idxM15_1, 
        idxM15_2, 
        idxM15_3, 
        idxM60_1, 
        idxM60_2,
        Peak,
        Valley  
    ); 
    vShort12[ii] = adviseShort();
    
    if (lReady && Train){
        if (vLong12[ii]>90) enterLong();
        if (vShort12[ii]>90) enterShort();
    }
}

....

void tryOrder(){
  
    algo("T_12");
        ... prepare data idx1..5
        runAdvise(0);
    
    algo("T_42");
        ... prepare data
        runAdvise(1);

    algo("D_7");
        ... prepare data
        runAdvise(2);


    algo("D_14");
        ... prepare data
        runAdvise(3);

    if (Test){
        algo("total");
            testFinal();
    }
   
}
Posted By: AndrewAMD

Re: multiple advise - 01/12/21 15:18

Now try the suggestion listed in the manual:
Quote
Error 049: Too many trades
The script entered more than one trade per bar and asset, which is normally a sign of a script bug - therefore the error message. If you really need a huge number of trades, for instance for unlimited grid trading or for training several advise functions at the same time, set the TradesPerBar variable to the required number of trades per bar and asset.
Posted By: Grat

Re: multiple advise - 01/12/21 15:31

I read manual. This not work?

MaxLong = MaxShort = -1; // only 1 open trade
Posted By: AndrewAMD

Re: multiple advise - 01/12/21 15:36

Change TradesPerBar.

MaxLong and MaxShort are ignored in [Train] mode, as noted in the manual.
© 2024 lite-C Forums