MA Slope Oscilator Strategy

Strategies are published here.

Moderator: admin

Re: MA Slope Oscilator Strategy

Postby Ramp711 » Wed Mar 20, 2013 4:22 pm

I find this strategy very useful. The following settings are working well on the Eur/JPY 5 min chart.

1st MA Slope
Price Source: Close
1st Ma Period: 2
Method: MVA
Slope: 0.0
Bars: 1

Second Ma Slope
Price Source: Weighted
Second MA Period: 200
Method: MVA
Slope: 0.0
Bars: 1

Optional Exit: No
Type of Signal: direct

Everything else should be left as per default

Generates quite an incredible number of pips with fractional lots. Back test on current Yen period, 2013 quite different to 2012.
Ramp711
 
Posts: 10
Joined: Wed Feb 20, 2013 12:54 pm

Re: MA Slope Oscilator Strategy

Postby Ramp711 » Thu Apr 25, 2013 8:31 am

Hi Apprentice, i would like to add three more slope parameters, this is the current code for two slopes:
Please help with the codingfor three more slopes

Code: Select all
        indicator1:update(core.UpdateLast);
      indicator2:update(core.UpdateLast);

    if period < first +1  then
        return ;
    end

    local now = core.host:execute("getServerTime");
    now = now - math.floor(now);

    if now >= OpenTime and now <= CloseTime then

     if   indicator1.DATA:colorI(period) ==  core.rgb(0, 255, 0)
      and  indicator2.DATA:colorI(period) ==  core.rgb(0, 255, 0)
      and ( indicator1.DATA:colorI(period-1) ~=  core.rgb(0, 255, 0)
      or  indicator2.DATA:colorI(period-1) ~=  core.rgb(0, 255, 0))
      then


            if Direction then
                BUY();
            else
                SELL();
            end

      elseif   indicator1.DATA:colorI(period) ==  core.rgb( 255,0, 0)
      and  indicator2.DATA:colorI(period) ==  core.rgb( 255,0, 0)
      and ( indicator1.DATA:colorI(period-1) ~=  core.rgb( 255,0, 0)
      or  indicator2.DATA:colorI(period-1) ~=  core.rgb( 255,0, 0))

       then
            if Direction then
                SELL();
            else
                BUY();
            end
        end

      if Exit then
                  if    indicator1.DATA:colorI(period) ==  core.rgb( 255,0, 0)
                  or  indicator2.DATA:colorI(period) ==  core.rgb( 255,0, 0)
                then
                        if   Direction then
                                 if haveTrades("B") then
                                    exit("B");
                                    Signal ("Close Long");
                                 end
                        else
                               if haveTrades("S") then
                                    exit("S");
                                    Signal ("Close Short");
                                 end

                        end
                 end
    if   indicator1.DATA:colorI(period) ==  core.rgb(0, 255, 0)
             or  indicator2.DATA:colorI(period) ==  core.rgb(0, 255, 0)
                then
                           if   Direction then
                              if haveTrades("S") then
                                 exit("S");
                                 Signal ("Close Short");
                              end
Ramp711
 
Posts: 10
Joined: Wed Feb 20, 2013 12:54 pm

Re: MA Slope Oscilator Strategy

Postby Apprentice » Mon Apr 29, 2013 4:49 am

Please explain ...
U need MASO indicator/stratetgy, based on a 5 MA slopes...
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: MA Slope Oscilator Strategy

Postby Ramp711 » Mon Apr 29, 2013 6:12 am

Yes i need a MASO strategy based on 5 MA slopes. The one you have created already has two, i need the option to use three more MA slopes.

Thanks in Advance
Ramp711
 
Posts: 10
Joined: Wed Feb 20, 2013 12:54 pm

Re: MA Slope Oscilator Strategy

Postby Apprentice » Fri May 03, 2013 4:20 am

Your request is added to the development list.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: MA Slope Oscilator Strategy

Postby Apprentice » Fri Dec 09, 2016 7:42 am

Strategy was revised and updated.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: MA Slope Oscilator Strategy

Postby albertparis » Fri Feb 10, 2017 10:10 am

Hello,
can you add :

1 Custom identifier

2 Max number of open position in any direction

3 Max number of position in one direction

Thank you in advance for your work
albertparis
 
Posts: 79
Joined: Thu Apr 28, 2016 11:52 am

Re: MA Slope Oscilator Strategy

Postby Apprentice » Sat Feb 11, 2017 5:51 am

Strategy was revised and updated.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Previous

Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 17 guests