coding 2 different exit scenarios

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #92617 quote
    fredrikfxfredrikfx
    Participant
    Junior

    Hi guys!

    Can someone help me with this code:

    CLOSE if EMA34 crosses over EMA54 or if the price is reached 70 pips from entry

    If any of this conditions match, close the trade.

     

    Thanks in advance

    #92630 quote
    NicolasNicolas
    Keymaster
    Legend

    Topic moved to correct forum (about automatic trading) and title changed to a title ” explicit enough to prompt the community to read your discussion. “, please respect some rules while posting, thanks in advance.

    Here is the code you need:

    if average[34,1] crosses over average[54,1] then 
     sell at market
     exitshort at market  
    endif 
    
    set target pprofit 70

    Long and sell orders are closed in this code, since you didn’t specified which kind of orders you’d like to be closed by the condition ..

    “price is reached 70 pips from entry” is what we call a takeprofit.

Viewing 2 posts - 1 through 2 (of 2 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

coding 2 different exit scenarios


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
fredrikfx @fredrikfx Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
7 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/01/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...