my code is not placing cumulative orders any idea?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36182 quote
    ramarama
    Participant
    Senior

    I have the following code written for placing cumulative orders.

    however it works fine(excellent) but placing only non cumulative orders

    // Main code : 1_imp_hr_forex_stop2_cum
    //-------------------------------------------------------------------------
    // Definition of code parameters
    DEFPARAM CumulateOrders = true
    DEFPARAM FlatBefore = 080000
    
    DEFPARAM FlatAfter = 180000
    Ctime = time > 080000 and time < 180000
    
    x=5
    IF ctime and not onmarket THEN
    BUY 2 PERPOINT AT close[1]+x stop
    
    sellshort 2 PERPOINT AT close[1]-x stop
    ENDIF
    x1=1
    x2=5
    z=1
    if longONMARKET then
    BUY z perpoint at tradeprice(1)+x2 stop
    endif
    
    if shortONMARKET then
    sellshort z perpoint AT tradeprice(1)-x2 stop
    endif
    set target profit 10
    set stop loss 2
    
    // Stops and targets
    if shortonmarket then
    buy at close[1]+x1 stop
    endif
    if longonmarket then
    sell at close[1]-x1 stop
    endif

     

    • Edited by moderator to make PRT code format appear, please use the <> button when inserting PRT code in your messages
    • Message moved from French forum to English forum, and from “ProBuilder” forum (indicators) to “ProOrder” forum (strategies)
    #36208 quote
    noisettenoisette
    Participant
    Veteran

    hello rama,

    Could you add forex pair and time frame because I did some backtests without any trade.

    Regarding lines 31 didn’t you want to use “exishort” fonction?

Viewing 2 posts - 1 through 2 (of 2 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

my code is not placing cumulative orders any idea?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
rama @rama Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by noisettenoisette
9 years, 4 months ago.

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