need help for conditional entry

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #189213 quote
    SwisspatrickSwisspatrick
    Participant
    New

    hi! I am having difficulties to implement an index based strategy and need help. It’s not about the pattern, but about the conditional entry that I need help.

    Setup of the pattern could be like

    1. take any condition to be true for the pattern today, e.g. high-low > 5
    2. when the pattern is true today, enter long tomorrow (and only tomorrow), but only when tomorrow’s high is higher than today’s high.

    The condition under 2) is like a stop-entry.

    Would be thankful if any of you could guide me with a very short code structure given the info above. Thank you.

    #189264 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    PatternToday = range > 5*PipSize   //range = high - low
    IF high > high[1] AND PatternToday[1] AND Not OnMarket THEN
       BUY 1 CONTRACT AT MARKET
    ENDIF
    Midlanddave thanked this post
    #191154 quote
    SwisspatrickSwisspatrick
    Participant
    New

    Dear Roberto,

    thank you for your reply. It worked well and I would like to enhance it.
    What do you need to add to:

    • trigger a buy only if the pattern happened in the last 3 bars
    • as the entry condition, take the high on the day when the pattern happened (which can be any of the 3 days)

    thank you ahead.

    #191188 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    PatternToday = range > 5*PipSize   //range = high - low
    IF PatternToday THEN
       EntryPrice = HIGH
    ENDIF
    IF high > EntryPrice AND Summation[3](PatternToday) AND Not OnMarket THEN
       BUY 1 CONTRACT AT MARKET
    ENDIF
Viewing 4 posts - 1 through 4 (of 4 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

need help for conditional entry


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
4 years, 5 months ago.

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