Please help me in my Bollinger Band EA in MT5

 

I am trying to create an EA that utilizes 2 Bollinger Bands (one with 1 std and and another with 1.5 std)

and i enter a position with a close below the bb(1 std) and markets price with a sl at the larger bb and a tp at the middle line , i wanna automatically modify the oder such that it moves the sl and tp to the latest value of the bolllinger band and the middle line i.e. the current candle has an index of 0 and the previous candle has an index of 1, so the bb values at index 1 . i want this to happen until either sl/tp is hit. can someone please guide me into the right direction??? i am an amateur and just getting started with this EA stuff. i am aware i can get the position ticket and use that to modify sl/tp but i have a hard time extracting the 2 values from the bb , the initial tp/sl and the modified sl/tp with every candle. i can get the values from ibands function and use the copy buffer function to extract the values , but i am only successful doing so for the initial sl/tp how do i extract the values for the rolling sl/tp , please help me out , thank you for the help,appreciate it.

Bollinger Bands - Trend Indicators - Technical Indicators - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help
  • www.metatrader5.com
Bollinger Bands (BB) are similar to Envelopes. The only difference is that the bands of Envelopes are plotted a fixed distance (%) away from the...
 
Vedansh Bhati: can someone please guide me into the right direction??
Code it to do what you want, or pay someone. Top of every page is Freelance.
Reason: