Looking for code for indicator optimisation. For a simplistic example – I am looking for the code to run a routine to optimise which two moving average lookbacks to use to maximise the gains from a moving average crossover strategy.
JSParticipant
Senior
Here is a simple “CrossOver” system that can be optimized…
You have two optimization parameters here: “FastPeriod” and “SlowPeriod”…
Import the “itf-file” (in the section “BackTesting & Auto Trading”)…
DefParam CumulateOrders=False //no cumulating orders
FastAvg=Average[FastPeriod](Close)//Fast Average
SlowAvg=Average[SlowPeriod](Close)//Slow Average
If FastAvg Crosses Over SlowAvg then
Buy 1 contract at Market
EndIf
If FastAvg Crosses Under SlowAvg then
SellShort 1 contract at Market
EndIf
i think he wants a code that optimize itself… something like Nicolas with HalfTrend adaptive length.
Fifty shades of Half Trend indicator