I have been messing around with trade simulation inside an indicator lately to try to find the highest expected profit signal from an array of signals(ie Optimization). I won't be posting this in the downloads sections because I am working on turning this into a much more complex animal, but thought this might trigger some interest from more experienced programmers that could help me with the new version I am working on.
This indicator simulates and tracks trades when the slope of 16 different HMA's changes direction. I have added one tick slippage to all these trades. These trades are categorized into longs and shorts, as well as the current market phase based on stochastics.
The market phases are:
OBR: Overbought rising- above upperlevel and rising
OBF: Overbought falling- above upperlevel and falling
R: Rising- between upper and lower and rising
F: Falling- between upper and lower and falling
OSR: Oversold rising- below lower and rising
OSF: Oversold falling - below lower and falling
The upper right panel shows the current slope of all the MA's as well as the expected profits of longs and shorts taken in that market phase when slope changes direction. This assuming you stayed in the trade until that same MA changed slope.
The lower right panel displays the current market phase
All the MA's are plotted as lines by default.
There is a MaxLong plot that plots triangle up for the MA with the maximum current expected long profit(taken at slope cross).
MaxShort plots down triangles for the MA with the maximum expected short profit(taken at slope cross)
Grey triangles mean the maximum expected profit plot is moving in opposite direction.
Blue and Black triangles means the maximum expected profit is negative.
Signals: Look for a recent change in direction of the maximums. Also look for the opposite maximum to be flattening out or ending its cycle. If grey triangles are starting to flatten out get ready for an entry. I attached a picture that might explain it better.
Known bug: MA0 triangle painted green one bar after MA0 is falling.