Pinescript Strategy for Trading Indicators

Job ID: 38017252

Budget: $250 – $750 USD

I require the development of a Pine Script algorithm capable of utilizing diverse indicators such as RSI, Williams %R, or other customized indicators to formulate a divergence tactic. This algorithm should possess adaptability allowing for the alteration of indicators or adjustment of indicator parameters to precisely calibrate the identification of peaks and valleys.

The identification of peaks and valleys will hinge on the transition between positive and negative trends of the indicator. For instance, when the indicator shifts from a positive trend to a negative one, the transition point is designated as a peak if the alteration surpasses a specific percentage defined within the code, denoted as the "Trigger changing percentage." The same methodology applies to valley identification but in the opposite direction.

For instance, if peak number 1 registers a value of 30 and peak number 2 records a value of 25, with the share price at peak number 1 at $100 and at peak number 2 at $150, this scenario signifies a negative indication with a sell signal atop the share trend. Conversely, if valley number 1 reflects a value of 30 and subsequent valley number 2 shows a value of 40, yet the share price at valley number 1 stands at $100 and at valley number 2 is merely $60, this indicates a positive signal, prompting a buy signal to appear on the share bar.

The algorithm should offer flexibility enabling the transition from RSI to alternative indicators or the adjustment of indicator values and Trigger changing percentages.

Project Milestones
a. Create code to numbering the indicator's peaks and valleys with the capability of:
• Changing the detection percentage that should be used to identify peaks and valleys.
• The indicator definition has to be faxable to the point I can change it or change it's parameters in order to adjust the peaks and valleys detection

b. Modify the code to link each peak and valleys with the specified price action (close, open, high, low, or midpoint) as per my selection.

c. The code should be able to identify the divergence in the following order:
• Negative Divergence if action price at Peak 1 is higher than action price at peak 2, while indicator peak 1 value is less than or equal indictor peak 2 value.
• Positive Divergence if action price at valley 1 is lower than the action price at valley 2, while the indicator valley 1 is lower or equal indicator valley 2 value.
d. Add buy or sell signal when the above rules are met on the price action and on the indicator.
Related categories: Visual Foxpro Pine Script