TradingView
xxattaxx-DisDev
2021年2月16日下午4點58分

Grid Bot Simulator 

Ethereum / TetherUSBinance

描述

This script is a grid bot simulator for ranging/choppy markets. Prices are divided into grids, or trade zones, that will trigger signals each time a new zone is entered. During ranging markets, each transaction is followed by a “take profit.” As the market starts to trend, transactions are stacked (compare to DCA), until the market consolidates. No signals are triggered above the Upper Limit or Below the Lower Limit.

Settings overview:
Upper Limit/Lower Limit : Highest and Lowest values for entire grid.
Number of Grids: Number of trade zones.
Show Grids: Show or hide all gridlines.
Show Only Current Grids: Only display the grids just above and just below the current trade zone.
High/Low for signals: If enabled, signals are triggered as soon as the price touches the next zone. If disabled, signals are triggered after bar closes. Enable this for “Once Per Bar alerts. Disable for “Once Per Bar Close” alerts.


Highlight Trade Zones

The grid bot should work well during ranging/choppy markets. Each zone will have only one trade, and then will immediately take profit in the next zone.

Ranging/Choppy Market

However, trending markets can produce multiple signals in rapid succession:

Trending Market

If the gridlines are compressing the chart space, enable the “Show Only Current Grids” in settings.

Show Only Current Grids disabled


Show Only Current Grids enabled

When changing symbols, adjust the Upper and Lower Limits to accommodate the new symbol. Otherwise, the chart will look compressed.

XBTUSD chart with ETHUSDT settings

The bot is a proof-of-concept and is considered experimental. Possible future updates will include Fibonacci grids and “smart entry/exits,” depending on the current trend. Comments and suggestions are encouraged.

發布通知

Adjusted signals to buy at LowerLimit and sell at UpperLimit if 'extremes' is enabled.

發布通知

  • Added market direction filter. Bot will skip ever other signal against market direction (up or down).
  • Added option for signal plot size.

發布通知

Fixed Upper and Lower Limit lines not showing

發布通知

Fixed signal arrow sizes

發布通知

Fixed "Transp" deprecation warning

發布通知

發布通知

Update to Pinescript Version 5.

New feature: Interactive upper/lower limit price selectors.

Use the price selectors to set the Upper and Lower Limits when adding the indicator to a new chart, or to interactively change the limits on a live chart.

To change Upper and Lower Limits on an active chart:

1. Click on the indicator to reveal the price selectors (tiny blue boxes)


2. Slide the boxes up or down to select the new price limits




When adding to a new chart, follow the prompts to set the “Upper Limit” price, then the “Lower Limit” price.
評論
ModeratorDE
Great Work! This script will be featured in the official german TradingView Newsletter!
Reisfelt
Can someone help me this seems to be the closest for what I need. I have permanent price lines and when it ticks to that price I want it to
xxattaxx-DisDev
@Reisfelt,

Thank you!

Can you be more specific about what you are looking for?
Reisfelt
@xxattaxx-DisDev, hi what I’m looking for is: I have price lines that never change so I call those my buy/sell lines. If the market is moving up to a price line I go short and if it is going down to a line I go long pretty basic stuff so far. But what I want the system to do is reverse my trade at the slightest indication it is going against me such as 2 ticks. I want it to reverse this way until it goes in my favor for $500 then it gets me out and it starts all over again on a new price line. I hope this makes sense sorry if it doesn’t so I am leaving my phone number. Grant 818-519-0843
PineCoders
KareemFarid
interesting. can this be turned to an automated bot that can excute orders directly on trading view using any of the available brokers?
xxattaxx-DisDev
@KareemFarid,

You could be able to do that in the webhook section of the alert box if you use a service like Alertartron or Scavengerbot
iman30v
Great Work.
Moreover, I added a feature to calculate the total profit and also profit per each sell signals.
So, one can evaluate the profit according to different parameters (trading range, number of grids), and back test from specific date and time. Therefore, It would be more suitable to choose the good parameters to set the grid bot in practice.

I will publish the code soon. [with a reference to the original code]
TehCrucible
@iman30v, did you get around to publishing this feature? I would be very interested in seeing it.
kallias
@iman30v, Any update ?
更多