Closing operations after reaching a daily profit

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #50149 quote
    Juan SalasJuan Salas
    Participant
    Master

    Dear colleagues,

    Sorry I have been away for a while. I am working on a code with daily operations. It works from 0200h to 2200h, and based on accumulation of contracts.

    I would like to sell or exit short when the profit of all my positions together is above 30 pips. I am using positionperf but obviously something is wrong.

    IF SHORTONMARKET AND COUNTOFPOSITION >= 3 AND positionperf>30*pipsize THEN
    EXITSHORT MARKET
    ENDIF

    Thanks in advance for your help and have a nice weekend.

    Juan

    #50150 quote
    DespairDespair
    Blocked
    Master

    Positionperf gives you the performance of the position in % and not in pips. This is where your code is wrong.

    #50236 quote
    Juan SalasJuan Salas
    Participant
    Master

    Hi Despair,

    Thanks for the information.

    Regards,

    Juan

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

Closing operations after reaching a daily profit


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Juan Salas @juan-salas Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Juan SalasJuan Salas
8 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/21/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...