sure lets do an example strategy
So i searched for a strategy on VIX week data (which is part of the predefined data sets)
I searched for a Long strategy with only 1 condition (so its super simple and not overfit)
I used 100% of the data to find the strategies
the VIX week dataset has 544 bars
The best strategy (after 10 cycles):
PF 1.8
trades 233
in app graph
View attachment 236714
the code
Code:int OnInit() { return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { } double getHighLowDiff_1() { return iHigh(NULL, PERIOD_W1, 1) - iLow(NULL, PERIOD_W1, 1); } double getClose_1() { return iClose(NULL, PERIOD_W1, 1); } double getAvgPriceLow_50_2() { return iMA(NULL, PERIOD_W1, 50, 0, 0, PRICE_LOW, 2); } double getCondition_0() { // PriceDiffThenPrevPrice(Close,AvgPriceLow(50),-0.07975,false,1,0.455078125) double diff = getClose_1() - getAvgPriceLow_50_2(); double hl = getHighLowDiff_1(); if(hl == 0){ return false; } else { double diffP = diff / hl; return diffP < -0.07975; } } bool isLong() { for(int i = 0; i < OrdersTotal(); i++) { if(OrderSelect(i, SELECT_BY_POS)) { if(OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) { return true; } } } return false; } void makeOrder() { double level = Ask; OrderSend(Symbol(), OP_BUY, 1, NormalizeDouble(level, Digits), 0,0,0); } void closeLong() { for(int i = 0; i < OrdersTotal(); i++) { if(OrderSelect(i,SELECT_BY_POS)) { if(OrderType() == OP_BUY) { int ticket = OrderTicket(); double usedAmount = OrderLots(); OrderClose(ticket, usedAmount, Bid,1); } } } } void OnTick() { bool isTrade = isLong(); bool shouldBeTrade = getCondition_0(); if(shouldBeTrade && !isTrade){ makeOrder(); } else if(!shouldBeTrade && isTrade){ closeLong(); } }
if nothing else one could read that the close of the last bar needs to be low and after that the strategy goes Long.
Which fits my knowledge (that the vix likes to return to some average price)
Now if you saw the graph in app its not very good but because its in the market almost half of the time many trades are merged (because you would have to otherwise reopen a trade right after closing one)
so in MT4 the graph looks like this
View attachment 236715
and 223 trades shrink to 46 (not only because of merging but also because MT4 maximum test trading period is Daily and so not all Week data is used (the daily data starts later))
last few trades
View attachment 236716
MT stats
View attachment 236717
....
so i also tried to search for strategies with 2 conditions.
it wasn't essentially better but similar results were achieved on much less trades (so technically you could use the free money on something else...)
Anyway i like VIX, its an easy market for me.
edit: one more thing, i do use strategies like this one yes, but this tool is new so i cant give real life results from it
Thanks for the detailed post. Going to look it over more closely later.
You said you used 100% of the data.
Can it train (and validate, if it does that) on, say, 50% of the data, then backtest on the out-of-sample other 50%?
Backtesting on OOS data will give a more accurate clue as to real world performance.

)
