ScalpMaster 10S

Viewing 15 posts - 1 through 15 (of 67 total)
  • Author
    Posts
  • #129258 quote
    Francesco
    Participant
    Veteran

    Since the trend of the moment is low timeframe systems, here is my proposal.
    Based on the “Pivot Support / Resistance Zones” indicator by robertogozzi.

    Position Size= 1
    Spread= 0.7

    EURUSD for now but maybe optimizable on different forex pairs

    defparam cumulateorders= false
    defparam flatbefore= 090000
    defparam flatafter= 220000
    
    once longtrading=1
    once shorttrading=1
    
    TIMEFRAME(15 minutes, updateonclose)
    // Settings
    ema1= exponentialaverage[20](close)
    ema2= exponentialaverage[10](close)
    bullish = close>ema1 and close>ema2 and ema1>ema2
    
    ema1= exponentialaverage[20](close)
    ema2= exponentialaverage[10](close)
    bearish= close<ema1 and close<ema2 and ema1<ema2
    
    TIMEFRAME(10 seconds)
    // Indicator
    myPivotSupportResistanceZones, myPivotSupportResistanceZones2 = CALL "Pivot Support/Resistance Zones"
    
    if longtrading then
    // Long
    if close crosses over myPivotSupportResistanceZones then
    if bullish then
    buy 1 contract at market
    endif
    endif
    endif
    
    if shorttrading then
    // Short
    if close crosses under myPivotSupportResistanceZones2 then
    if bearish then
    sellshort 1 contract at market
    endif
    endif
    endif
    
    // Stop Loss
    set stop ploss 15
    
    // Trailing Stop
    trailingstart= 50
    trailingstep= 2
    
    // Rest Stoploss
    if not onmarket then
    newsl= 0
    endif
    
    // Manage Long Positions
    if longonmarket then
    // First Move
    if newsl= 0 and close-tradeprice(1)>=trailingstart*pipsize then
    newsl= tradeprice(1)+trailingstep*pipsize
    endif
    // Next Moves
    if newsl>0 and close-newsl>=trailingstep*pipsize then
    newsl= newsl+trailingstep*pipsize
    endif
    endif
    
    // Manage Short Positions
    if shortonmarket then
    // First Move
    if newsl= 0 and tradeprice(1)-close>=trailingstart*pipsize then
    newsl= tradeprice(1)-trailingstep*pipsize
    endif
    // Next Moves
    if newsl>0 and newsl-close>=trailingstep*pipsize then
    newsl= newsl-trailingstep*pipsize
    endif
    endif
    
    // Stop Order To Exit The Positions
    if newsl>0 then
    sell at newsl stop
    exitshort at newsl stop
    endif
    
    1.jpg 1.jpg 2-1.jpg 2-1.jpg
    #129262 quote
    Francesco
    Participant
    Veteran

    Sorry, there is an error with the code, from line 22 to 39 its

    if longtrading then
    // Long
    if close crosses over myPivotSupportResistanceZones2 then
    if bullish then
    buy 1 contract at market
    endif
    endif
    endif
    
    if shorttrading then
    // Short
    if close crosses under myPivotSupportResistanceZones then
    if bearish then
    sellshort 1 contract at market
    endif
    endif
    endif

    Updated results

    1-1.jpg 1-1.jpg 2-2.jpg 2-2.jpg
    #129268 quote
    robertogozzi
    Moderator
    Master

    Good job.

    Are you running it on your demo account?

    #129269 quote
    Francesco
    Participant
    Veteran

    Good job.

    Are you running it on your demo account?

    Just ultimated it today, i will run it from monday 🙂

    #129276 quote
    Francesco
    Participant
    Veteran

    Update v2

    -minor optimization on the indicator
    -system now works with both breakouts and bounces

    defparam cumulateorders= false
    defparam flatbefore= 090000
    defparam flatafter= 220000
    
    once longtrading=1
    once shorttrading=1
    
    TIMEFRAME(15 minutes, updateonclose)
    // Settings
    ema1= exponentialaverage[20](close)
    ema2= exponentialaverage[10](close)
    bullish = close>ema1 and close>ema2 and ema1>ema2
    
    ema1= exponentialaverage[20](close)
    ema2= exponentialaverage[10](close)
    bearish= close<ema1 and close<ema2 and ema1<ema2
    
    TIMEFRAME(10 seconds)
    // Indicator
    myPivotSupportResistanceZones, myPivotSupportResistanceZones2 = CALL "Pivot Support/Resistance Zones"
    
    if longtrading then
    // Long
    if close crosses under myPivotSupportResistanceZones or close crosses over myPivotSupportResistanceZones2 then
    if bullish then
    buy 1 contract at market
    endif
    endif
    endif
    
    if shorttrading then
    // Short
    if close crosses under myPivotSupportResistanceZones or close crosses over myPivotSupportResistanceZones2 then
    if bearish then
    sellshort 1 contract at market
    endif
    endif
    endif
    
    // Stop Loss
    set stop ploss 15
    
    // Trailing Stop
    trailingstart= 50
    trailingstep= 2
    
    // Rest Stoploss
    if not onmarket then
    newsl= 0
    endif
    
    // Manage Long Positions
    if longonmarket then
    // First Move
    if newsl= 0 and close-tradeprice(1)>=trailingstart*pipsize then
    newsl= tradeprice(1)+trailingstep*pipsize
    endif
    // Next Moves
    if newsl>0 and close-newsl>=trailingstep*pipsize then
    newsl= newsl+trailingstep*pipsize
    endif
    endif
    
    // Manage Short Positions
    if shortonmarket then
    // First Move
    if newsl= 0 and tradeprice(1)-close>=trailingstart*pipsize then
    newsl= tradeprice(1)-trailingstep*pipsize
    endif
    // Next Moves
    if newsl>0 and newsl-close>=trailingstep*pipsize then
    newsl= newsl-trailingstep*pipsize
    endif
    endif
    
    // Stop Order To Exit The Positions
    if newsl>0 then
    sell at newsl stop
    exitshort at newsl stop
    endif
    
    keewee and GraHal thanked this post
    1-2.jpg 1-2.jpg 2-3.jpg 2-3.jpg
    #129287 quote
    Francesco
    Participant
    Veteran

    Fun fact: works very good also on 1sec without changing nothing in the code. Synonymous of robustness and no overfitting?

    keewee and MAKSIDE thanked this post
    1-3.jpg 1-3.jpg 2-4.jpg 2-4.jpg
    #129296 quote
    Vonasi
    Moderator
    Master

    Synonymous of robustness and no overfitting?

    …or perhaps synonymous with getting something to work on a tiny part of history!

    #129298 quote
    Francesco
    Participant
    Veteran

    This is the main problem of working on systems with a low time frame,I have also repeatedly expressed my being doubtful about them.
    Personally don’t know if I would ever start such a system on my live account

    MAKSIDE thanked this post
    #129300 quote
    MAKSIDE
    Participant
    Veteran

    i wish you it works on 10S/1S…  it’s so difficult this TF..

    #129301 quote
    swedshare
    Participant
    Senior

    Franscesco, would you like to share the ITF so we get the right indicator bundled with the strategy?

    #129302 quote
    GraHal
    Participant
    Master

    So what do I need to do to get round the attached message?

    Francesco.jpg Francesco.jpg
    #129304 quote
    robertogozzi
    Moderator
    Master

    I Think it’s because Francesco must have customized the indicator to return the two values, which is not in the original indicator, written to just plot segments, not returning data.


    @Francesco
    please post your version of the indicator, ad TXT and/or ITF file.

    GraHal thanked this post
    #129305 quote
    Francesco
    Participant
    Veteran

    @GraHal That happens because you didn’t add return values in the indicator.
    Here’s the ITF with the complete and optimized indicator.

    EDIT: robertogozzi preceded me with the explanation 🙂

    GraHal and swedshare thanked this post
    ScalpMaster-v2.itf
    #129313 quote
    GraHal
    Participant
    Master

    Haha Thanks Francesco …. can’t wait for Monday now to try it out!! 🙂

    Its good on DJI 5 sec and not a loser on DAX and USTech … if I recall correctly?  I just flashed it over what was in my List.

    Might it not be even better if the Indicator was not called but included within the strategy code and then below could be optimised ?

    Or maybe I need to understand how it all hangs together, before making suggestions.

    I’ll probably try this and that anyway over the weekend.

    Keep up the Good Work!

     

    PivotBAR     =  3                      //3  bars AFTER  pivot
    LookBack     =  4                    //4  bars BEFORE pivot
    swedshare thanked this post
    #129321 quote
    Francesco
    Participant
    Veteran

    Yes GraHal, i guess it could be easily adapted for different assets, heres what we can optimize:

    First of all PivotBAR and LookBack,  but for eurusd 3 and 4 is already optimized. And yes! we can easily include the indicator in the strategy without the call in order to better optimize the values; v3 will have that for sure, already tried now!

    Then the periods of the ema’s for the bullish and bearish detection (maybe ML on that?)

    And of course sl and ts.

    GraHal, swedshare and Scooby thanked this post
Viewing 15 posts - 1 through 15 (of 67 total)
  • You must be logged in to reply to this topic.

ScalpMaster 10S


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 66 replies,
has 14 voices, and was last updated by javi cano
5 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/01/2020
Status: Active
Attachments: 30 files
Logo Logo
Loading...