1 Min Trading Strategy

Viewing 10 posts - 211 through 220 (of 220 total)
  • Author
    Posts
  • #52727 quote
    Jessar
    Participant
    Senior

    what do you mean by + 10 – 10 strategies? I do not understand

    #56171 quote
    GraHal
    Participant
    Master

    Jessar when Inertia said (in  #52704) … “10 +or-  strategies were stopped on the demo account from October 27th” … I guess he was saying around 10 / about 10 / approximately 10 were stopped … etc.

    GraHal

    Inertia thanked this post
    #56181 quote
    GraHal
    Participant
    Master

    Has this Thread ‘died a death’ due to the many and various Strategies proving to be losers in the long run?

    If anybody can provide a version or a link or identify from the list of Attachments (very useful!) a Strategy version that is profitable then I would be for ever in your debt!

    Thank You
    GraHal

    #56190 quote
    Inertia
    Participant
    Master
    //-------------------------------------------------------------------------
    // Code principal : Wall Street Good Morning !
    //-------------------------------------------------------------------------
    //Stategy: Scalping Candles
    //Market: DAX
    //Timeframe: 1min
    //Spread: 1
    //Author: Juan Jacobs ()
    
    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False
    DEFPARAM FLATBEFORE = 152500
    DEFPARAM FLATAFTER = 234500
    noEntryBeforeTime = 152500
    timeEnterBefore = time >= noEntryBeforeTime
    noEntryAfterTime = 190000
    timeEnterAfter = time < noEntryAfterTime
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    TS = 10 // 10
    n= 500
     
    If longonmarket and close < positionprice and (barindex-tradeindex) > 650 Then
    Sell at market
    ElsIf shortonmarket and close > positionprice and (barindex-tradeindex) > 60 then
    Exitshort at market
    EndIf
     
    body=close-open
    abody=abs(body)
    if (range+0.0000001)>0 then
    ratio=abody/(range+0.0000001)
    else
    ratio=0
    endif
     
    middle=(open+close)/2
    bodytop=max(open, close)
    bodybottom=min(open, close)
    shadowtop=high-bodytop
    shadowbottom=bodybottom-low
    longcandle= (ratio>0.6)
     
    Bull = 0
    
    //Bullish Signals
     
    MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
    if MorningStar then
    Bull = 1 //Positive
     
    endif
     
    PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
    if PiercingLine then
    Bull = 1 //None
    endif
     
    AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
    if AbandonedBabyBottom then
    Bull = 1 //None
    endif
     
    ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
    if ThreeInsideUp then
    Bull = 1 //Positive
    endif
     
    ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
    if ThreeOutsideUp then
    Bull = 1 //Positive
    endif
     
    ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
    if ThreeWhiteSoldiers then
    //Bull = 1 //Increase Drawdown
    endif
     
    ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
    if ConcealingBabySwallow then
    Bull = 1 //None
    endif
     
    BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if BullishHarami then
    //Bull = 1 //Negative Impact
    endif
     
    HomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if HomingPigeon then
    Bull = 1 //None
    endif
     
    BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if BullishEngulfing then
    Bull = 1 //Positive
    endif
     
    LastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if LastEngulfingBottom then
    Bull = 1 //None
    endif
     
    DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if DragonflyDojiBottom then
    Bull = 1 //None
    endif
     
    GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if GravestoneDojiBottom then
    Bull = 1 //None
    endif
     
    DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
    if DojiStarBottom then
    Bull = 1 //None
    endif
     
    BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if BullishHaramiCross then
    Bull = 1 //None
    endif
     
    ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2]  and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
    if ThreeStarsInTheSouth then
    Bull = 1  //None
    endif
     
    BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
    if BullishBreakaway then
    Bull = 1 //None
    endif
     
    Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if Hammer then
    Bull = 1 //None
    endif
     
    InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if InvertedHammer then
    Bull = 1 //None
    endif
     
    RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if RisingThreeMethods then
    Bull = 1 //None
    endif
     
    BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
    if BullishThreeLineStrike then
    Bull = 1 //None
    endif
     
    BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and  close>high[3] and close>high[2] and close>high[1])
    if BullishMatHold then
    Bull = 1 //None
    endif
     
    BullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody)
    if BullSash then
    Bull = 1 //Positive
    endif
     
    BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
    if BullSeparatingLine then
    Bull = 1 //None
    endif
     
    BullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])
    if BullishCounterAttack then
    Bull = 1 //None
    endif
     
    BullishKicking=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop=0 AND shadowbottom=0)
    if BullishKicking then
    Bull = 1 //None
    endif
     
    indicator1 = ExponentialAverage[n](close)
    c3 = (close > indicator1)
    indicator1 = ExponentialAverage[n](close)
    indicator1 = ExponentialAverage[n](close)
    c4 = (indicator1 > indicator1[2])
    
    //Entry/Exit Criteria
    possize = 1
    NearMA = Average[7,2](close)
    If countofposition = 0 and Bull = 1 and NearMA[1] > NearMA[3] and RSI[2](close) > 60 and NearMA > Average[150,2](close) and timeEnterBefore and timeEnterAfter and not daysForbiddenEntry and (c3 AND c4) Then
    //If shortonmarket Then
    //Exitshort at market
    //EndIf
    Buy possize contract at market
    EndIf
     
    If countofposition = 0 and NearMA[1] < NearMA[3] and RSI[2](close) < 25 and NearMA < Average[150,2](close)and timeEnterBefore and timeEnterAfter and not daysForbiddenEntry Then
    //If longonmarket Then
    //Sell at market
    //EndIf
    //Sellshort possize contract at market
    EndIf
    
    //trailing stop
    trailingstop = TS
    if not onmarket then
    MAXPRICE = 0
    priceexit = 0
    endif
     
    //LONG order
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
    if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
    priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price level
    endif
    endif
     
    //exit on trailing stop price levels
    if onmarket and priceexit>0 then
    EXITSHORT AT priceexit STOP
    SELL AT priceexit STOP
    endif
      
    Set Target %Profit 0.8 // 0.42
    SET STOP %loss 0.4// 0.46
    

    Thank you JuanJ !

    GraHal and Juan Salas thanked this post
    1-min-strategy.png 1-min-strategy.png
    #56199 quote
    Vonasi
    Moderator
    Master

    Inertia – are those results on a live account or a demo account? I only ask as I coded a 1 minute strategy that worked fantastically in back testing and walk forward testing and demo forward testing and then failed terribly when I ran it live with real money (I haven’t had time to find out why yet due to a Windows10 update breaking my laptop for the second time this month).

    #56419 quote
    juanj
    Participant
    Master

    The strategy is profitable, I have modified different versions of the strategy with success.

    I have been taking a break from the forum and development the last couple of weeks but will be back in January.

    Algo development is continuous trial and error, you have to risk some to gain some.

    Algo’s are unlikely to remain profitable in the long run without some minor modifications.

    GraHal thanked this post
    #57108 quote
    Leo
    Participant
    Veteran

    You define three times the “indicator1” at line 179. why?

    #57125 quote
    Vonasi
    Moderator
    Master

    Probably because if any of the code was created by the ‘Simplified Creation’ tool in PRT then it does silly things like that.

    #57135 quote
    Inertia
    Participant
    Master

    Hi Leo…I am a beginer in coding so I copy/paste from ProOrder what I want…

    But absolutly, once would have been more than enough.

    Thx.

    #57236 quote
    Leo
    Participant
    Veteran

    Hi Leo…I am a beginer in coding so I copy/paste from ProOrder what I want… But absolutly, once would have been more than enough. Thx.

    Can you tell me wich variables do you optimize?

    Thanks i a

Viewing 10 posts - 211 through 220 (of 220 total)
  • You must be logged in to reply to this topic.

1 Min Trading Strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
juanj @juanj Participant
Summary

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

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