Auto back test

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #70822 quote
    ChrisNYEChrisNYE
    Participant
    Senior

    Coding query

    What code do I require if = I want my current trade to close before another trade is opened? What I am finding in my back testing ‘order list’ is that I get multiple triggers. I only want to trigger a new trade entry once the prior trade has been closed by either my stop or take profit target.

    Thank you

    Chris Wilson

    #70824 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    When you test conditions to enter a trade you should add the keyword ONMARKET to test whether you already have, or don’t have, any open trade

    IF MyConditions AND Not OnMarket THEN
       BUY/SELLSHORT....
    ENDIF

    also, you may add at the very beginning of your code (where DEFPARAMs need to be located)

    DEFPARAM CumulateOrders = false

    you can use both.

    #70826 quote
    ChrisNYEChrisNYE
    Participant
    Senior

    Thank you – I just saved this in my template

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

Auto back test


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ChrisNYE @chrisnye Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by ChrisNYEChrisNYE
8 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/19/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...