• Overview
  • Reviews (1)
  • Comments (10)
  • What's new

Virtual pending sell stop order

The script is intended for automatic placing of Sell Stop pending orders, Stop Losses and Take Profits on the user specified levels. This script is not that useful as "Virtual pending buy stop", since short positions are opened as Bid price crosses the levels. Thus spread widening is not dangerous. Nevertheless, you need to have this script to prevent unwanted hitting of the Stop Loss levels.

Main Purposes:

  1. Automation of the process of placing the Sell Stop pending orders, Stop Losses and Take Profits on user-specified levels in case a brokerage company prohibits placing such orders closer than 'n' points from the current price.
  2. Avoiding unwanted triggering of Stop Loss in case a quote pierces a significant level (fractal) without further confirmation with the close price.
  3. Setting Take Profit levels.

The goals are reached by the following means. The script doesn't place a real pending order for buying. It places a market order once the Bid price reaches the level specified by the trader. Thus, brokers can widen the spread as much as they want. You will be safe and you'll enter a short position as the price reaches a really significant level. In addition, the script includes the so called "tracking" Stop Loss that will close an unprofitable position only when the price closes above the STOPLOSS level, not when it just hits this level. Take Profit is not virtual, it is actually placed.

Script Settings:

  • LOT - lot size, 0.1 on default.
  • DEVIATION - price deviation, 10 on default.
  • LEVEL - trigger level for the virtual "waiting" Buy Stop order in units of the price chart. 1.10 on default.
  • STOPLOSS - Stop Loss level in units of the price chart. 1.00 on default.
  • TAKEPROFIT - Take Profit level in units of the price chart. 1.30 on default.
  • NEWCHECK - restriction on setting a stop after restart (allows setting/modifying a Stop Loss after entering a position). False on default.

The specified level for entering a position, the Stop Loss and Take Profit levels are marked with lines of different colors on the chart.

knomkom 2017.07.22 06:55 

User didn't leave any comment to the rating

Version 1.4 2017.08.24
Added the function to write log entries about reasons of the script completion and positions control.