Author of the Idea: Yuri, Code Creator: barabashkakvn.
Understanding Position Opening Signals:
- Stoh_main_1: The Stochastic Oscillator value on bar #1.
- InpStochasticLevel: The threshold for the Stochastic level.
- AC_1: The Accelerator Oscillator value on bar #1.
- ACPrev_2: The Accelerator Oscillator value on bar #2.
BUY Signal: This triggers when the Stochastic Oscillator on bar #1 exceeds the Stochastic level input and the Accelerator Oscillator on bar #1 is greater than that on bar #2. Additionally, the Accelerator Oscillator on bar #1 must be above zero, while that on bar #2 should be below zero:
if(Stoh_main_1>InpStochasticLevel && AC_1>ACPrev_2 && AC_1>0 && ACPrev_2<0 && count_buys==0)
SELL Signal: This occurs when the Stochastic Oscillator on bar #1 is below the Stochastic level input and the Accelerator Oscillator on bar #1 is less than that on bar #2. Here, the Accelerator Oscillator on bar #1 has to be below zero, while that on bar #2 should be above zero:
if(Stoh_main_1<InpStochasticLevel && AC_1<ACPrev_2 && AC_1<0 && ACPrev_2>0 && count_sells==0)
Example of a SELL Signal:

Upon receiving a signal, we open five positions with the same lot size. The first position has a Stop Loss and Take Profit set to zero. For all subsequent positions, each has a predefined Stop Loss, while the Take Profit increases incrementally based on the input Take Profit (in pips).
Testing Results Across All Symbols on PERIOD_D1:

Comments 0