Close open position based on volume

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #221330 quote
    123harry123harry
    Participant
    New

    Hi,

    I would appreciate some help in code creating with the purpose of closing an open position that is losing if the volume during a candle stick exceeds a certain limit. Is that possible?

    As an example, I have an opened a buy order at 16.00. Timeframe is set to 15 minutes. If that position is generating a loss after 15 minutes, when the candlestick closes, I want the open position to be closed.

    BR

    Harry

    #221331 quote
    123harry123harry
    Participant
    New

    …I want to close that position if it is generating a loss and the volume is above a certain limit… Sorry, I was not able to edit my message.

    #221351 quote
    JSJS
    Participant
    Master

    Hi @123harry

    You can try this…

    If NOT OnMarket and OpenTime=160000 then
    Buy at Market
    EndIf
    
    If OnMarket and PositionPerf<0 and Volume>10000 then
    Sell at Market
    EndIf
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Close open position based on volume


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
123harry @123harry Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by JSJS
3 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/20/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...