Close open position based on volume

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #221330 quote
    123harry
    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
    123harry
    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
    JS
    Participant
    Senior

    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.

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 JS
2 years, 5 months ago.

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