No SHORT trades?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7864 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I wrote this simple strategy as an exercise to get used to (and a bit more skilled in) programming ProOrder:

    SMA = Average[20](close)
    // short positions
    IF open < SMA then
    SELL  1  CONTRACT AT MARKET
    endif
    // long positions
    IF open > SMA then
    BUY  1  CONTRACT AT MARKET
    endif

     

    Unfortunately it only opens LONG positions, what’s wrong with my code?

    Thank you.

    #7865 quote
    NicolasNicolas
    Keymaster
    Legend

    Because SELL instruction is made to close the long positions.

    If you want to launch short positions on market, you should use the SELLSHORT instruction instead.

    #7871 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Thanks Nicolas, I Always appreciate your help!

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

No SHORT trades?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

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