Mean reverting on specific points

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113070 quote
    LohanLohan
    Participant
    New

    Hello!

    i want to make a system that mean reverting on specifick Points, so lets say DAX opens at 13 100 when DAX go up 30 Points to 13 130 i want to short or down to 13 070 (30p) i want to go long.

    Can you help me with this code? many thanks!

    /L

    #113071 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    DEFPARAM CumulateOrders = false
    ONCE Distance = 30 * pipsize
    IF IntraDayBarIndex = 0 THEN
       OpenPrice = open
    ENDIF
    EntryLong  = OpenPrice - Distance
    EntryShort = OpenPrice + Distance
    IF close <= EntryLong  AND Not OnMarket THEN
       BUY 1 CONTRACT AT MARKET
    ENDIF
    IF close >= EntryShort AND Not OnMarket THEN
       SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    SET TARGET pPROFIT 100
    SET STOP   pLOSS   50
    Nicolas and PLermite thanked this post
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

Mean reverting on specific points


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Lohan @lohan Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 10 months ago.

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