bull & bear volumes strategy

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #66009 quote
    Meta Signals Pro
    Participant
    Veteran

    Hi there,

    I am trying to set a simple strategy based on this indicator

    Bear and Bull volume indicator

    Here are the conditions:

    BUY :

    • if the bull-volume-green-bar CROSSES (i.e is superior) the simple moving average of the past 23 bull-volumes
    • if the bull-volume-green-bar CROSSES (i.e is superior) the simple moving average of the past 23 bear-volumes

    SELL:

    • if the bear-volume-green-bar CROSSES the simple moving average of the past 23 bull-volumes
    • if the bear-volume-green-bar CROSSES the simple moving average of the past 23 bear-volumes

    I tried to use the automatic coding system but it does not work; I tried also to code it myself using moving average but it is not working either.

    Can anyone help me on this?

    Thanks

    Chris

     

     

    Bear and Bull volume indicator

    #66020 quote
    GraHal
    Participant
    Master

    BUY : if the bull-volume-green-bar CROSSES (i.e is superior) the simple moving average of the past 23 bull-volumes

    if the bull-volume-green-bar CROSSES (i.e is superior) the simple moving average of the past 23 bear-volumes

    SELL: if the bear-volume-green-bar CROSSES the simple moving average of the past 23 bull-volumes

    if the bear-volume-green-bar CROSSES the simple moving average of the past 23 bear-volumes

    I don’t understand above (but that’s okay cos it’s not my system! 🙂 ) as you refer ONLY to green bars in both Buy and Sell conditions??

    Looking at the Chart I would say as attached??

    Just a few thoughts? Maybe wrong??
    GraHal

    Kris.jpg Kris.jpg
    #66029 quote
    Meta Signals Pro
    Participant
    Veteran

    Hi Grahal,

    Thanks for your interest;

    > BUY is actually an entry when the green bar crosses the 2 averages (bear and bull volumes)

    > SELL is an Exit when the red bar crosses the 2 averages (bear and bull volumes)

    Would you know how to code this ?

    Best

    Chris

    #66030 quote
    GraHal
    Participant
    Master

    You need to code a Buy, Sell, SellShort, Exitshort into the code below … in place of the Return at the bottom.

    I might have a go tomoz, but off to bed now 🙂

    Here’s a start if you are nightbird??  Not tested, but all the hard work has been done by @gabri in his Bear Bull Vol Indicator.

    PS volbear looks like it needs to be more than volbear – volume ?

    If VolBull Then
    Buy at Market
    Endif
    
    If VolBear Then
    SellShort at market
    Endif

     

    ref=(close-low)/range
    volbull=ref*volume
    volbear=volume
     
    if close>=open then
     greenbarcount=1
     greenvolume=volume
     redbarcount=0
     redvolume=0
    else
     greenbarcount=0
     greenvolume=0
     redbarcount=1
     redvolume=volume
    endif
    //media volumi rossi e verdi per media mobile semplice
    mmred=summation[period](redvolume)/summation[period](redbarcount)
    mmgreen=summation[period](greenvolume)/summation[period](greenbarcount)
     
    return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred colo
    #66117 quote
    gabri
    Participant
    Master

    Chris,

    here’s the code. I assumed that when you wrote “if the bear-volume-green-bar CROSSES the simple moving” you actually meant “if the bear-volume-RED-bar CROSSES the simple moving”. I just want to add a personal note, from a NON BELIEVER in automatic trading. I am a discretional trader because I think that there is no way to substitute a mediocre brain with a super computer. I made this indicator to help to analyse with the Wyckoff method a certain stock. This indicator is supposed to confirm or not the price action of a stock inside a trading range and define the phase the stock is in. It might work in other situations but it was never tested for this purpose.

     

    Gabriele

    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    
    //Basic parameters
    period=23
    ref=(close-low)/range
    volbull=ref*volume
    volbear=volume
    
    if close>=open then
    greenbarcount=1
    greenvolume=volume
    redbarcount=0
    redvolume=0
    else
    greenbarcount=0
    greenvolume=0
    redbarcount=1
    redvolume=volume
    endif
    //media volumi rossi e verdi per media mobile semplice
    mmred=summation[period](redvolume)/summation[period](redbarcount)
    mmgreen=summation[period](greenvolume)/summation[period](greenbarcount)
    //return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred coloured (255,0,0) as "Bear average",mmgreen as "Bull average"
    //Entering the market
    c1=(volbull crosses over mmgreen) and (volbull>mmred)
    c2=(volbull > mmgreen) and (volbull crosses over mmred)
    
    c3=(volbear crosses under mmgreen) and (volbear<mmred)
    c4=(volbear < mmgreen) and (volbear crosses over mmred)
    
    //long entry and exit rules
    if c1 or c2 then
    buy 3000 cash at market
    endif
    if c3 or c4 then
    sell at market
    endif
    //short entry and exit rules
    if c3 or c4 then
    sellshort 3000 cash at market
    endif
    if c1 or c2 then
    exitshort at market
    endif
    GraHal, Nicolas and Meta Signals Pro thanked this post
    #66120 quote
    robertogozzi
    Moderator
    Master

    To write code, please use the <> “insert PRT code” button.

    Thank you.

    #66132 quote
    GraHal
    Participant
    Master

    Thought I’d give it a whirl! 🙂 Period 18 and spread = 2

    Tried adding various to reduce that long slide in equity curve, but none made enough difference to leave in the code.

    GraHal

    Gabri.jpg Gabri.jpg
    #66147 quote
    Meta Signals Pro
    Participant
    Veteran

    Hey Gabriele,

    Thank you very much for your reply, your time and code expertise (and your self correction of the trigger 🙂

    You made my day !

    Did you try this strategy directly inspired by your brillant indicator?

    Is there a way to emprove it?

    Cheers,

    Chris

    PS : thanks Grahal for your support; I am checking it right away;

    #66148 quote
    Meta Signals Pro
    Participant
    Veteran

    Sorry Gabriele,

    Just red more closely your warnings about “industrialising” this strategy and your message indirectly answering my questions.

    ; thanks also for pointing out this Wyckoff that is just what I needed to formalize my intuitions and method;

    I would be interested in sharing thoughts in MP; I have just a few questions promise;

    here is my mail ct197475 (at) hotmail.fr;

    Chris

    #66159 quote
    GraHal
    Participant
    Master

    Yeah Kris75 ,  it’s an interesting one alright! 🙂

    Be good if you can work it so that gain doesn’t slip away over the following weeks?

    Cheers
    GraHal

    #66172 quote
    GraHal
    Participant
    Master

    I’ve got it running on Demo, the last 2 trades entered at a good logical point and went to a very good profit in a short time, but then the profit turned to loss.

    So the entry may be okay (but only 2 trades in last 2 hours) but the Exit may need work (but aren’t exits nearly always a pain to get right?).

    #66175 quote
    gabri
    Participant
    Master

    I did, sometimes it’s not taken. 🙂

    #66176 quote
    gabri
    Participant
    Master

    @grahal even in a markup phase of the market a crossing signal might not be the right entry sometimes. You have to exit your long position when you start to see distribution and this means:

    1. When the target is met;
    2. When the uptrend line is broken;
    3. when volumes are showing selling pressure in a range market (and in this case you will see bulls stronger than bears)

    Hard to make this automatic….at least for me 😀

    #66178 quote
    GraHal
    Participant
    Master

    I agree gabri and hard for me also! 🙂

    I have moved over to a weird way of trading (most would think?)  but I try anything and everything … keeps my interest up!

    I enter via a coded Strat, which also has coded exits, but I nearly always see that the trade needs to exit before the exit code executes (for similar reasons as you say above). So I exit manually and then pop the Strat back running again! 🙂

    It looks (from Demo performance this morning) that your code could be a good candidate for my weird trading method! 🙂  I’ll have to get into your code and Wyckoff fully then give it a shot!

    Thank You
    GraHal

    #66234 quote
    gabri
    Participant
    Master

    GraHal, I actually think you have a very smart strategy.

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

bull & bear volumes strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 14 replies,
has 4 voices, and was last updated by gabri
7 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/21/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...