Here you go, as per Mr Sub's specs but in EasyLanguage <font color="blue"> {Indicator: RandomPrice} {Author: atavachron - March 2005} Inputs: startingPrice(1170), tickValue(0.25), directionalBias(0.1), randomizeDirectionalBias(true), trendContinuationFactor(0.65), rerun(0); {*** NOTE *** rerun is a dummy Variable - change to any value in order to rerun simulation} Vars: rndNumber(0), price(startingPrice), mydirectionalBias(directionalBias); {LONG Directional Bias} if mydirectionalBias <= 0.5 then begin rndNumber = Random(1); if (randomizeDirectionalBias = true) then mydirectionalBias = Random(1); if (rndNumber < trendContinuationFactor) then begin price = price + tickValue; end else begin price = price - tickValue; end; end else {SHORT Directional Bias} begin rndNumber = Random(1); if (randomizeDirectionalBias = true) then mydirectionalBias = Random(1); if (rndNumber < trendContinuationFactor) then begin {Cannot have -ve prices} if price > 0 then price = price - tickValue; end else begin price = price + tickValue; end; end; Plot1(price, "Random Price"); </font> The randomizeDirectionalBias boolean variable is my addition - it allows one to randomly vary the bias on a per bar basis. The rerun variable is simply a dummy variable, in order to allow TS to regenerate the random price curve. Enjoy...
If it would be random chance, than over the long term i should average more likely a 0% return with 50 % of loosing trades and 50% of winning trades, which isn't the case. In lottery the honesty of the system can be statistically tested. By use of math one can calculate with great probability that the balls all have equal chances to be choosen. So in the long term all balls should approx appear as often as the others when the lottery goes out. This is not the case in what i said: at least 75% of winners over any given period, that's to me no random chance at all, and NO loosing weeks in whatever timeframe you choose, that' s no random chance at all to me. But one thing is for sure: there are, and always will be, people that will deny every prove of anything that they don't like or don't understand. They are so full of having the one and only truth that they will never ever take time to think about the possibility that there might be something that they don't know about. They react as if they have the same infallibility that is claimed by the pope. This last paragraph was not referring to Lefty, it was a general remark towards the "harddie antitrenders". Give me any chart and i can prove that trend works, and also that anti trend works. It all depends on picking the right timing for the trade.
and last one trying the different permutations (of course there are many values to play about with). Interesting results, even with such a simplistic model...
Unfortunately TS8 ELS will not import into TS2000i (which can only import ELD and ELA files). TS8 can import ELD, ELA and its native ELS. Try this instead... <font color="Blue"> {Indicator: RandomPrice} {Author: atavachron - March 2005} Inputs: startingPrice(1170), tickValue(0.25), directionalBias(0.1), randDirBias(true), trendContFactor(0.65), rerun(0); {*** NOTE *** rerun is a dummy Variable - change to any value in order to rerun simulation} Vars: rndNumber(0), price(startingPrice), mydirectionalBias(directionalBias); {LONG Directional Bias} if mydirectionalBias <= 0.5 then begin rndNumber = Random(1); if (randDirBias = true) then mydirectionalBias = Random(1); if (rndNumber < trendContFactor) then begin price = price + tickValue; end else begin price = price - tickValue; end; end else {SHORT Directional Bias} begin rndNumber = Random(1); if (randDirBias = true) then mydirectionalBias = Random(1); if (rndNumber < trendContFactor) then begin {Cannot have -ve prices} if price > 0 then price = price - tickValue; end else begin price = price + tickValue; end; end; Plot1(price, "Random Price"); </font> if memory serves, TS2000i doesn't like long variable names - all I did is shorten a couple of them. Hope this helps. Cheers.