Hunter on the channel breakout BuyStop SellStop
- Utilities
- Aleh Sasonka
- Version: 1.1
- Updated: 28 September 2022
Script Hunting for the Channel Breakout
The script is designed for semi-automatic trading. It can place required number of pending BuyStop and SellStop orders with preset StopLoss and TakeProfit levels in one go.
The script calculates the channel width using the ZigZag indicator and places a grid of pending BuyStop and SellStop orders according to specified settings. The first pair of pending BuyStop and SellStop orders is placed at the specified distance from the channel's borders. This distance is set in parameters as percentage from the calculated channel width. The channel width is calculated by preset number of extremum points of the ZigZag indicator. Each order has StopLoss and TakeProfit levels (set in parameters). The next pair of orders is placed on the TakeProfit level of the previous pair.
The script distinguishes two-three and four-five digit quotes. Values of parameters are specified in points (the second or the fourth decimal place).
Usage:
Drag the script name on the chart from the navigator panel and specify required parameters in the window appeared.
Make sure that trading is allowed. Check the box on the second tab. Otherwise orders will not be placed!
Adjustable parameters:
- The size of the bet - size of the bet for each grid order in lots
- The TakeProfit level - take profit for each grid order in points
- The StopLoss level - stop loss for each grid order in points
- The number of bets in the series - number of orders in each series (1 - one pair of orders - one BuyStop and one SellStop)
- The indentation from the channel to % - indent of the first pair of pending orders from the channel's border as percentage of the channel width
- Number of calculation points zigzag - number of the Zigzag's reference points to plot the channel
- Depth - the setting of the zigzag indicator - the Depth parameter of the Zigzag indicator (see below)
- Deviation - the setting of the zigzag indicator - the Deviation parameter of the Zigzag indicator (see below)
- Backstep - the setting of the zigzag indicator - the Backstep parameter of the Zigzag indicator (see below)
- To create the signal line Up,Dn - Up and Dn signal lines - horizontal lines with relevant names used for visual monitoring of the channel's borders by the Zigzag indicator (true - create, false - not to create)
- Slippage - slippage (parameter for placing orders)
- Arrow color orders BuyStop(Blue) - color of the BuyStop order arrow - no arrows by default
- Arrow color orders SellStop(Red) - color of the SellStop order arrow - no arrows by default
By the way: Depth is a minimum number of bars, which will not have the second maximum/minimum smaller/larger by Deviation pips, than the previous one. Backstep is a minimum number of bars between maximums/minimums.
Up and Dn signal lines can be used by ** Signal on the Channel Breakout ** {See my other work} EA for notifying a trader about crossing the calculated channel's border.
It makes sense to set the shift (indent) of the first pair of pending orders by Fibonacci levels - 23.6, 38.2, 50.0, 61.8.
Comment:
The script displays the following comment in the upper left corner of an active chart:
- script name and its main parameters
- calculated channel width
- calculated shift of the first pair of orders
Alternative usage:
The script can be used instead of an adviser to ** News Hunter Bot Onetime ** {See my other work} for manual exhibiting the grid of orders before releasing news.