This code snippet demonstrates how to implement pending stop orders in the ProBuilder language, which is used within the ProRealTime trading platform. The script sets up conditions for entering long and short positions based on the highest and lowest prices within a specified time range, adjusting these entry points by a defined pip size.
// Check if already on the market
if onmarket then alreadytraded=1 endif
// Define the trading range between 0000h to 0600h
IF TIME=060000 THEN
channelhigh = Highest[12](high)
channellow = Lowest[12](low)
ENDIF
// Define order lines with a margin of 3.5 pips
orderhigh= channelhigh + 3.5*pipsize
orderlow= channellow - 3.5*pipsize
// Set conditions for opening LONG positions
IF Operationaltime AND alreadytraded = 0 THEN
BUY 10 CONTRACT AT orderhigh stop
// Set alreadytraded to 1 after placing the order
// alreadytraded = 1
ENDIF
// Set conditions for opening SHORT positions
IF Operationaltime AND alreadytraded = 0 THEN
SELLSHORT 10 CONTRACT AT orderlow stop
// Set alreadytraded to 1 after placing the order
// alreadytraded = 1
ENDIF
The code snippet above is structured to manage trading orders based on specific market conditions defined within a certain timeframe. Here’s a step-by-step breakdown:
This example is useful for understanding how to automate trading strategies based on time-specific price ranges and controlled entry points in the ProBuilder language.
Check out this related content for more information:
https://www.prorealcode.com/topic/price-question/#post-69615
Visit Link