Request for Automated strategy 2BarUpDn

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #172363 quote
    martobrien1
    Participant
    New

    Hi Folks,

    Does any have a code for a strategy i would like to use?

    Entry on 2nd bar for  long and to short

    Exit on 2nd bar ie, red to exit long, and exit on 2nd green bar for shorting

    Also to be able to stop automated on either long or short while allowing one or the other to run.

     

    I thank you for allowing me to pick your brains

    Margaret

    #172366 quote
    robertogozzi
    Moderator
    Master

    When launching the strategy how does the count of bars need to start?

    The first two green bars trigger a Long trade and the first two red bars a Short trade?

    So it’s a continuous Stop & Reverse where two bars of the same colour exit an open trade and open a new, opposite, one?

    What’s the rule to stop trading one direction or the other?

    martobrien1 thanked this post
    #172367 quote
    martobrien1
    Participant
    New

    Hi Roberto

    Yes that’s correct the entry on 2nd bar of either and exit on 2nd bar is like a stop and reversal yes.

    The rule for to stop either going long or short running in automated doesn’t need to be a rule but i thought it may be good fine tuning in case of say a long trade where the shorts weren’t worth taking where you could intervene and put  stop to the shorts or longs to minimize losses.

    But yes the reversal continuously is my main brainchild.

    What do you think lol!

    #172368 quote
    martobrien1
    Participant
    New

    As for the start of the strategy simply just on the 2nd bar for entry say 1 red then 2nd consecutively would be entry point

    #172370 quote
    martobrien1
    Participant
    New

    i have carried out calculations and tested via a walkthrough in realtime and the results are good enough for my first strategy idea

    #172371 quote
    martobrien1
    Participant
    New

    Incase you test the strategy i have been using Heikin Ashi and the results can vary dependant on the market best 5 minute time frame

    #172375 quote
    robertogozzi
    Moderator
    Master

    Ok, I’ll code something asap.

    #172376 quote
    martobrien1
    Participant
    New

    i can see your page and im very impressed with your trading resume also that you make codes for prorealcode if there is a cost for your services please let me know, and thankyou Roberto, Margaret

    robertogozzi thanked this post
    #172377 quote
    robertogozzi
    Moderator
    Master

    On the forum coding is absolutely free.

    #172379 quote
    martobrien1
    Participant
    New

    Thankyou very much!

    #172380 quote
    martobrien1
    Participant
    New

    signing off tonight until tomorrow

    #172430 quote
    robertogozzi
    Moderator
    Master

    There you go, this is the basic code (tested on DAX, Daily TF):

    DEFPARAM CumulateOrders = False
    Bullish = close > open
    Bearish = close < open
    BullishSignal = Bearish[2] AND Bullish[1] AND Bullish
    BearishSignal = Bullish[2] AND Bearish[1] AND Bearish
    IF BullishSignal AND Not LongOnMarket THEN
       BUY 1 CONTRACT AT MARKET
    ELSIF BearishSignal AND Not ShortOnMarket THEN
       SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    martobrien1 thanked this post
    #172478 quote
    martobrien1
    Participant
    New

    Thanks Roberto i will test your strategy now,  you are a great person!

    #172527 quote
    murre87
    Participant
    Senior

    Can someone present backtest 6 month for this one

    #172537 quote
    Paul
    Participant
    Master

    MTF might be interesting. 4hour timeframe,  2 or xx bars minimum green/red , in Heikin Ashi

    15 minute entry every 2nd or xx bar only in the direction set by 4 hour, also with  Heikin Ashi.

    Maybe close on change in direction in 15m, but not trading against the 4 hour trend.

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

Request for Automated strategy 2BarUpDn


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 15 replies,
has 4 voices, and was last updated by martobrien1
4 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/24/2021
Status: Active
Attachments: No files
Logo Logo
Loading...