![]()
The Son of a Gun Indicator (SOG) is a complete indicator/trading system . It carries out a two-parameter optimisation process for a novel Discrete Price Oscillator (DPO), so that the optimised parameters can be adopted to run the Signal Mode for exporting into an EA. In the Optimisation Mode, the top and bottom three optimised sets of parameters are tabulated on screen. The program automatically sets the top instantaneous performance displayed (in Blue), or the performance ranking selected by the user. Or it can be set manually. The lime coloured circles are open buys and red ones open sell. The mean of all performance iterations is displayed in green. The magenta line is the mean of top performers, andred line for mean of bottom performers. In this mode also, one can set upper and lower trend lines, and fractals, for assistance in manual prformance-following trading. Also, the conventional trade-close performance can be displayed onscreen for comparison with strategy tester results (yellow line in last screenshot).
The novel Discrete Price Oscillator (DPO) is the difference between the closing price of two higher time frames: a fast higher time frame and a slow high time frame. For example if the chart period is M15, and the fast period is 8 and the slow period is 16, then the oscillator is the difference between the 2H and the 4H time-frame closing prices (note: all possible custom time frames included up to a 100 time frame multiplier factor.).
In the Signal Mode, all inputs are suppressed except for the starting date and the fast and slow periods. Unlike the optimisation mode, the indicator here runs in real time, allowing for exporting into an EA. The first buffer is a signal buffer (+10 for long and -10 for short, but the signal is not displayed).
Because this trading system has only two independent parameters, the optimisation should not be some form of curve fitting, but this is something that is yet to be established.
Price history is limited to 7000 bars, so as not to hang up your computer processor in optimisation mode.
There is no alternative to spending time playing with the input controls to learn the system. Good luck
Also, it occurred to me that if you want to import the signal with iCustom, you will nee all input variable types, most are quite obvious, here they are, but remember that in the Signal Mode you will only need to set the three mentioned above:
enum enmode {
Optimization_Mode,
Signal_Mode,
};
extern enmode Mode_of_Operation=Optimization_Mode;
extern datetime Time_at_Start=D'2022.06.01 00:00';
extern int Maximum_Period = 50;
extern int Top_Performers = 25;
extern bool Auto_Set = TRUE;
extern int Set_Fast_Period = 22;
extern int Set_Slow_Period = 25;
extern int Start_Rank = 1;
extern bool Display_Oscillator = FALSE;
extern bool Display_Signal = FALSE;
extern bool Display_Performance=FALSE;
extern bool Deduct_Spread=TRUE;
extern bool Show_Means=TRUE;
extern bool Show_Fractals=FALSE;
extern bool Show_Trades=TRUE;
//+------------------------------------------------------------------+
extern int Half_String=12;
extern bool Display_Trendlines = TRUE;
extern int X_1=100;
extern int X_2=20;
extern double Prcnt_H_1=20.0;
extern double Prcnt_H_2 =20.0;
extern double Prcnt_L_1 =20.0;
extern double Prcnt_L_2 =20.0;