inside bar strategy

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #144036 quote
    abro163
    Participant
    Average

    Hi I’m a beginner and I coded this from examples on the forum,  the strategy buys / shorts the inside bar breakout and closes next bar open.

    It seems to work properly on all timeframes except higher timeframe like my intended daily TF? Can anyone help,   I would also prefer to close before weekends.  Is it an issue with my time zone settings?

    edit : seemed to fix it by changing buy n share at high[1] stop and low[1],

    how can I close before the weekend?

    Defparam cumulateorders = false
    
    REM inside bar
     
    
    harami = high[0]<high[1] and low[0]>low[1]
    n=1
    
    amplitude = high - low
    
    
    if harami  THEN
    
    buy n share at high stop
    
    endif
    if harami  then
    sellshort n share at low stop
    endif
    set stop loss amplitude
    
    
    IF BarIndex >= (TradeIndex ) THEN
    SELL      AT MARKET
    EXITSHORT AT MARKET
    ENDIF
     
    
    #144038 quote
    abro163
    Participant
    Average

    Sorry I checked again my edit did not fix it.

    #144048 quote
    abro163
    Participant
    Average

    After some more research, it looks like the error is because of sunday candle.  I tried turn off display weekend data, but that doesnt fix it

    #144049 quote
    GraHal
    Participant
    Master

    how can I close before the weekend?

    To close at 210000 on Friday, try …

    Timeframe (1 Hour, updateonclose)
    If Day = 5 and Time = 200000 Then
    Sell at Market
    ExitShort at Market
    Endif
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

inside bar strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
abro163 @abro163 Participant
Summary

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

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