Execution of order with immediate time

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39777 quote
    CHIFHE
    Participant
    Junior

    can anyone help me to code the program below to execute trade immediately when the condition meet without waiting 2hrs period close for the price action.

    // Definition of code parameters
    
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
     
    
    // Conditions to enter long positions
    
    indicator1 = Cycle(close)
    
    c1 = (indicator1 CROSSES OVER -13)
    
    indicator2 = CCI[20]
    
    c2 = (indicator2 < 100)
    
     
    
    IF c1 AND c2 THEN
    
    BUY 2 CONTRACT AT MARKET
    
    ENDIF
    
     
    
    // Conditions to exit long positions
    
    indicator3 = CCI[20]
    
    c3 = (indicator3 CROSSES OVER 100)
    
     
    
    IF c3 THEN
    
    SELL AT MARKET
    
    ENDIF
    
     
    
    // Conditions to enter short positions
    
    indicator4 = Cycle(close)
    
    c4 = (indicator4 CROSSES UNDER 13)
    
    indicator5 = CCI[20]
    
    c5 = (indicator5 > -100)
    
     
    
    IF c4 AND c5 THEN
    
    SELLSHORT 2 CONTRACT AT MARKET
    
    ENDIF
    
     
    
    // Conditions to exit short positions
    
    indicator6 = CCI[20]
    
    c6 = (indicator6 CROSSES UNDER -100)
    
     
    
    IF c6 THEN
    
    EXITSHORT AT MARKET
    
    ENDIF
    
     
    
    // Stops and targets
    
    SET STOP pLOSS 250
    Mudzili-auto-stratergy.docx
    #40207 quote
    Nicolas
    Keymaster
    Master

    Until the new multi timeframe support to come, the only way to launch orders between 2 bars is to use pending orders. But in this case, we need to know at which price levels they need to be put at market and they do not be executed instantly also..

    Because indicators are computed on Close (for most of them and that’s the case in your strategy), why do you want to take orders on not confirmed calculation? (when the candlestick is closed and the information is written in the marble 😉 )

    Khaled thanked this post
    #40229 quote
    CHIFHE
    Participant
    Junior

    Thanks nico

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

Execution of order with immediate time


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
CHIFHE @tshivhmc1 Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/04/2017
Status: Active
Attachments: 1 files
Logo Logo
Loading...