open new position when long onmarket

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #150541 quote
    Mishap
    Participant
    Junior
    IF longonmarket and close - tradeprice > 10*pipsize then
    buy 5 SHARES AT MARKET
    ENDIF

    Hi Guys,

    Im having trouble with the above code working on a forex pair. I have looked & read a few posts about this & it all seems to make sense but when i apply it to a forex pair it doesn’t seem to have the effect of opening extra positions. I have tried running the code without the extra position & i get the same amount of trades. ie it doesn’t add more.

    Am i missing something here?

    Apologies if this has been posted before regarding forex. I have had a decent look & can only find posts relevant to shares. even still i have ran he math & it should enter a trade but doesnt seem to

    #150542 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    Can’t help but notice you don’t mention (in order to rule it out as possible cause) having activated cumulating orders with the appropriate defparam line at the beginning of the code, so in absence of visibility of the whole code I have to ask just in case, do you have this line set on “TRUE” at the beginning of the code?

    DEFPARAM CUMULATEORDERS = TRUE

    https://www.prorealcode.com/documentation/cumulateorders/

    Mishap thanked this post
    #150548 quote
    Mishap
    Participant
    Junior

    Yes that was it, thanks Noobywan. i changed it to false to see if something else was causing a separate issue & forgot to reset it (I feel a bit silly).

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

open new position when long onmarket


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Mishap @mishap Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/15/2020
Status: Active
Attachments: No files
Logo Logo
Loading...