Inside Bar Strategy, Pro-order.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #95481 quote
    abacus23
    Participant
    Average

    I am trying to write a pro-order strategy code, based around the inside bar.

    I have looked online to try and help, but the assisted creation only seems to be able to get me so far, I can’t seem to progress any further.  I have looked through previous strategies, but they are not helping.

    Here goes…

    For the inside bar to be valid, it must include the extreme wicks, so it is completely inside the previous candle.

    Hourly chart, DOW.

    No trades on Saturday or Sunday.

    No time restrictions.

    If an inside bar occurs, the strategy looks for certain conditions, to take, or not take, the trades.

    Condition 1; if the price close at 23:00 today, is higher than the price close at 23.00 yesterday, then only a long position can be taken, off the inside bar.

    Condition 2: if the price close at 23:00 today, is lower than the price close at 23.00 yesterday, then only a short position can be taken, off the inside bar.

    Stop: 5 pips higher/lower, than the inside bar low/high including the wicks.

    Target: Size of the inside bar, (including high/low wicks).

    I have attached a chart as an example.

     

    I don’t mind having a go with the code, if people give hints.

    Indicator1 was my screener, that show yellow or blue candles, when it is an inside bar.

    DEFPARAM CumulateOrders = False
     
    n = 1
     
    REM Définition du Harami
    c1= high[0] < high[1]
    c2= low[0] > low[1]
    harami = c1 and c2
    
    CALL "INSIDE BAR"
    c1 = (close > indicator1)
    
    IF c1 THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF
    
    tcondition = time>230000 and time<000000
    
    IF harami and close < open and not daysforbiddenentry THEN
    buy n shares at market nextbaropen
    ENDIF
     
    IF harami and close > open and not daysforbiddenentry THEN
    sellshort n shares at market nextbaropen
    ENDIF
     
    // Clôture
    IF barindex - tradeindex = 1 THEN
    sell at market
    exitshort at market
    ENDIF
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    DJI-1-hour.png DJI-1-hour.png
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Inside Bar Strategy, Pro-order.


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
abacus23 @abacus23 Participant
Summary

This topic contains 1 voice and has 0 replies.

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