my code is not placing cumulative orders any idea?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36182 quote
    rama
    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
    noisette
    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.

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 noisette
8 years, 9 months ago.

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