Newbie First Steps Syntax query

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #251267 quote
    Mellstock
    Participant
    New

    Hi I am new to PRT but not to coding.

    I want play around with the program in my IG demo account.

    I want run a simple program to open a trade to see how things work.

    This is a simple program on the S&P One minute chart. It will not run.

    What am I doing wrong? The Buy word is underlined in red in the coding window. An error message is given if I try to run it.

    I have tried Contracts, Contract, Unit, Units and just entered the number. I cannot get the syntax correct.

    If High[0] > Close[1] + 0.25 Then

    Buy 1 Contracts at market

    Endif

    Thank you

    #251269 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    “buy” being a code keyword working only in the proorder module (for backtests and automatic strategies), it would be considered as an error when entered in the probuilder code editor window (for displaying indicators, not for buying/selling) or the proscreener window (for screeners to select assets from a list, no buying or displaying) instead of a proorder one. So in case that’s what might have happened here, it might be worth double checking the code is tested in a proorder window rather than probuilder or proscreener?

    GraHal, Mellstock and Iván González thanked this post
    #251270 quote
    GraHal
    Participant
    Master

    Try with below as the 1st line of your code.

    DEFPARAM CUMULATEORDERS = False

    What is the error message saying?

    Also , it may due to this onging problem (not your coding)

    Algo stopped Position closed

    Mellstock, JC_Bywan and Iván González thanked this post
    #251272 quote
    Mellstock
    Participant
    New

    Thank you for this.

    The error shows as Buy word is underlined in red.

    I have tried Defparam cumulate orders = False at the top of the code.

    cumulateorders gets underlined in red.

    I am in indicators and have successfully coded 2 indicators.

    Am I in the right coding window to build a system? If not where should I be?

    I am not finding the software intuitively easy to use at present.

    Yes I have seen recent messages about IG and the interface with PRT.

    Thanks again.

    GraHal thanked this post
    #251273 quote
    Mellstock
    Participant
    New

    Thank you.

    Possibly I am working at this in the wrong coding window.

    How do I get into the ProOrder coding window?

    #251275 quote
    JC_Bywan
    Moderator
    Master

    When you click on the “indicators” button, it opens a window called “indicators and trading systems”, where presumably you have landed on the indicators tab being the first out of 3, displaying your indicators list. Below the window title and above the list, you have the 3 tabs there, and if you are in PRT v12 the 2nd tab is the proorder one: probacktests and automatic trading (if still in PRT v11 it’s the 3rd tab)

    GraHal, Iván González and Mellstock thanked this post
    #251772 quote
    Mellstock
    Participant
    New

    Thank you I was using the wrong coding environment. Thank you for coreectly directing me

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Newbie First Steps Syntax query


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Mellstock @mellstock Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by Mellstock
4 months, 3 weeks ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/22/2025
Status: Active
Attachments: No files
Logo Logo
Loading...