Skip to main content

Random Buy Sell AFL for Amibroker (AFL)

koyak13 about 13 years ago Amibroker (AFL)

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

AFL that randomly buys and sells. Useful as a benchmark – If a formula works below the performance of this, ditch it.

Indicator / Formula

Copy & Paste Friendly
//Buy Random
Buy_Random = Param("Buy_Random",0,0,1);
if(Buy_Random) {
Frequency = 10;
NextRandom = Random(39023);
Buy = IIf(NextRandom<Frequency/252,1,0);
}

//Sell Random
Sell_Random = Param("Sell_Random",0,0,1);
if(Sell_Random){
Frequency = 10;
NextRandom = Random(73234);
Sell  = IIf(NextRandom<Frequency/252,1,0) AND NOT Buy;
}

5 comments

about 13 years ago

@tradermind

Hey Thanks Bro. Happy to know that. You must be talking about traderji.

Leave Comment

Please login here to leave a comment.