Mean reverting on specific points

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113070 quote
    Lohan
    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
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
6 years, 3 months ago.

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