Skip to main content

SPSO - Standard Particle Swarm Optimizer for Amibroker (AFL)

vishp127 over 9 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    amibroker, optimize

Standard Particle Swarm Optimizer is based on SPSO2007 code that is supposed to produce good results provided that correct parameters (i.e. Runs, MaxEval) are provided for particular problem.

Picking correct options for the PSO optimizer can be tricky therefore results may significantly vary from case to case.

Indicator / Formula

Copy & Paste Friendly
// finding optimum value in 1000 tests within search space of 10000 combinations

OptimizerSetEngine("spso");
OptimizerSetOption("Runs", 1 );
OptimizerSetOption("MaxEval", 1000 );

sl = Optimize("s", 26, 1, 100, 1 );
fa = Optimize("f", 12, 1, 100, 1 );

Buy = Cross( MACD( fa, sl ), 0 );
Sell = Cross( 0, MACD( fa, sl ) );

0 comments

Leave Comment

Please login here to leave a comment.