Confirmation of Trend using Neural Networks (by kind permission of Leo)

Viewing 15 posts - 16 through 30 (of 38 total)
  • Author
    Posts
  • #79212 quote
    raphaelopilskiraphaelopilski
    Participant
    Senior

    this would be nice for the dax. Because of the Margin. It´s the half of Dow. Anyone tried?

    #79220 quote
    GraHalGraHal
    Participant
    Master

    Mmm thought it was a bit too good to be true! Just a bit though! 🙂

    I have done a pessimistic calculation / check of results and £300 – £400 of profit is due to the spike we have had to endure at 21:15 on the Dow for the last 5 nights or so.

    4 trades have been affected at 21:15, 1 lost around 350 due to the spike and 3 gained 200 due to the spike!

    The 4 spiked tradess may have gone on to be gainers anyway if the spike hadn’t triggered the SL and TP. I guess I could work this out, but the coffee hasn’t worked through yet! 🙂

    Results are still good though as v1.0 is currently trading at a genuine around £600 profit over 6 days (950 – 350 due to IG spikes! ).

    I will put a time filter on the strategy when I get chance.

    #79288 quote
    GraHalGraHal
    Participant
    Master

    Vonasi proposed so here it is …  SPTRD on 1 Min TF 100k bars, spread = 4

    DEFPARAM CUMULATEORDERS = False
    //Variables:
    candlesback=5
    ProfitRiskRatio=2
    spread=1.5
     
     
    myATR=average[20](range)+std[20](range)
    ExtraStopLoss=MyATR
    //ExtraStopLoss=3*spread*pipsize
     
    //for long trades
    classifierlong=0
    FOR scanL=1 to candlesback DO
    IF classifierlong[scanL]=1 then
    BREAK
    ENDIF
    LongTradeLength=ProfitRiskRatio*(close[scanL]-(low[scanL]-ExtraStopLoss[scanL]))
    IF close[scanL]+LongTradeLength < high-spread*pipsize then
    IF lowest[scanL+1](low) > low[scanL]-ExtraStopLoss[scanL]+spread*pipsize then
    classifierlong=1
    //candleentrylong=barindex-scanL
    BREAK
    ENDIF
    ENDIF
    NEXT
    IF classifierlong=1 and Close > Average[120](close)then
    //DRAWSEGMENT(candleentrylong,close[barindex-candleentrylong],barindex,close[barindex-candleentrylong]+LongTradeLength) COLOURED(0,150,0)
    //DRAWELLIPSE(candleentrylong-1,low[barindex-candleentrylong]-ExtraStopLoss,barindex+1,high+ExtraStopLoss) COLOURED(0,150,0)
    Buy 2 Contract at Market
    ENDIF
    
    //for short trades
    classifiershort=0
    FOR scanS=1 to candlesback DO
    IF classifiershort[scanS]=1 then
    BREAK
    ENDIF
    ShortTradeLength=ProfitRiskRatio*((high[scanS]-close[scanS])+ExtraStopLoss[scanS])
    IF close[scanS]-ShortTradeLength > low+spread*pipsize then
    IF highest[scanS+1](high) < high[scanS]+ExtraStopLoss[scanS]-spread*pipsize then
    classifiershort=1
    //candleentryshort=barindex-scanS
    BREAK
    ENDIF
    ENDIF
    NEXT
     
    IF classifiershort=1 and Close < Average[120](close) then
    //DRAWSEGMENT(candleentryshort,close[barindex-candleentryshort],barindex,close[barindex-candleentryshort]-ShortTradeLength) COLOURED(150,0,0)
    //DRAWELLIPSE(candleentryshort-1,high[barindex-candleentryshort]+ExtraStopLoss,barindex+1,low-ExtraStopLoss) COLOURED(150,0,0)
    SellShort 2 Contract at Market
    ENDIF
     
    SET TARGET PROFIT 70
    SET STOP PLOSS 35
    
    Leo-14.jpg Leo-14.jpg Leo-15.jpg Leo-15.jpg
    #79311 quote
    VonasiVonasi
    Moderator
    Master

    Vonasi proposed so here it is …  SPTRD on 1 Min TF 100k bars, spread = 4

    Why 4 pips? The SP500 spread is never that big.

    #79312 quote
    4everTrading4everTrading
    Participant
    Senior

    Hey Everyone!!

    Such a nice work!! Amazing results from the beginning, Congrats guys!!!

    I would like my little idea to improve the results. Months ago I added an indicator to the library. I think this indicator can prevent fake entries, basiclly I added two more conditions to the original code:

    AverageVolumeBuy > AverageVolumeSell and AverageVolumeBuy > 50

    It is only a little bit improve, and please guys please to share your opinion. I hope you like.

     

    Saludos!!

    Nicolas thanked this post
    Resume_1.png Resume_1.png Resume_2.png Resume_2.png Long-Trading-Trend-5-min-Vol.itf
    #79333 quote
    GraHalGraHal
    Participant
    Master

    Why 4 pips? The SP500 spread is never that big.

    I forgot, I forgot okay!? We all make mistakes!? 🙂

    Also Lot size = 2 on my results above.
    S&P500 is min Lot size 5, so more mistakes on my part! 🙁

    I hope you like.

    Yeah looks good, thanks! The more the merrier! 🙂

    #79542 quote
    StefanbStefanb
    Participant
    Senior

    GraHal

    200k on your SP500 spread=2.

    GraHal thanked this post
    1-min-200k-sp500.jpg 1-min-200k-sp500.jpg
    #79544 quote
    StefanbStefanb
    Participant
    Senior

    X

    I did a 200k test on your code.

    v.jpg v.jpg
    #79548 quote
    GraHalGraHal
    Participant
    Master

    @Stefanb  @Xusto @anybody … got any tweaks / fixes for that big drawdown shown on Stefanb screenshot over 200k bars above??

    Please post your tweaked / fixed code on here with screen shot of equity curve and performance results.

    #79549 quote
    NicolasNicolas
    Keymaster
    Legend

    Equity curve stagnation and lose come from ranging market. This seems normal for a strategy that detects market movements and bets on their continuity 🙂

    #79550 quote
    GraHalGraHal
    Participant
    Master

    Well we need code to keep out of the market when ranging?

    #79551 quote
    GraHalGraHal
    Participant
    Master

    X I did a 200k test on your code.

    Above is for Xusto version with the volume tweak in post 79312.

    ( @stefanb in case you don’t know and for others … if you select part of the text of a post and THEN click on Quote on the right above the post then the selected text displays as a quote … very useful).

    #79557 quote
    StefanbStefanb
    Participant
    Senior

    Here is a code that I will start live soon.

    Have run it om demo for a while and it seems to be working ok.

    Spread=1

    Op 75%

    DEFPARAM CumulateOrders = False
    DEFPARAM PRELOADBARS = 200
    
    indicator1 = SuperTrend[1,8]
    c1 = (close <= indicator1)
    indicator4 = SuperTrend[1,4]
    c4 = (close <= indicator4)
    c2 =  DIplus[6](close) >  DIminus[3](close)
    
    HL = 14 // Hour of Long Entry
    HLS = 12 // Hour of Long Exit
    HS = 7 // Hour of Short Entry
    HSS = 15 // Hour of Short Exit
    LATR = 9// Number of ATRs for Stop Loss
    PATR = 21 // Number of ATRs for Take Profit
    ATR = 18 // ATR period
    
    IF Hour=HL and c1 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    
    If LongOnMarket AND Hour=HLS THEN//
    SELL AT MARKET
    ENDIF
    
    IF Hour=HS and c2 and c4 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    
    IF ShortOnMarket AND Hour=HSS THEN
    EXITSHORT AT MARKET
    ENDIF
    
    SET STOP LOSS LATR*AverageTrueRange[ATR](close)
    SET TARGET PROFIT PATR*AverageTrueRange[ATR](close)
    
    IF Hour=HS and c2 and c4 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    
    IF ShortOnMarket AND Hour=HSS THEN
    EXITSHORT AT MARKET
    ENDIF
    
    SET STOP LOSS LATR*AverageTrueRange[ATR](close)
    SET TARGET PROFIT PATR*AverageTrueRange[ATR](close)
    
    GraHal and 4everTrading thanked this post
    EURUSD-5-min.jpg EURUSD-5-min.jpg
    #79559 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Lines 34-35 are duplicate and you may remove them.

    Moreover, your SL & TP will change each new candle, while they should not while on market, I think you should use line 44 to write

    If Not OnMarket then

    and add line 47 with  ENDIF

    #79561 quote
    GraHalGraHal
    Participant
    Master

    Lines 37 to 46 are all duplicated?

    I guess maybe finger trouble with copy and paste??

Viewing 15 posts - 16 through 30 (of 38 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Confirmation of Trend using Neural Networks (by kind permission of Leo)


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 37 replies,
has 8 voices, and was last updated by GraHalGraHal
8 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/24/2018
Status: Active
Attachments: 22 files
ProRealCode ProRealCode
Loading...