No SHORT trades?

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

    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
    Nicolas
    Keymaster
    Master

    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
    robertogozzi
    Moderator
    Master

    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.

No SHORT trades?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by robertogozzi
9 years, 9 months ago.

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