moving average trading system MetaStock conversion request

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #95144 quote
    luckyhaa
    Participant
    Junior

    Can anyone convert this metastock moving average trading system code into proreal time

     

    _SECTION_BEGIN(“Price”);
    SetChartOptions(0,chartShowArrows|chartShowDates);
    _N(Title = StrFormat(“{{NAME}} – {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}”, O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
    Plot( C, “Close”, ParamColor(“Color”, colorDefault ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );
    _SECTION_END();

    _SECTION_BEGIN(“AP 13ma sys”);
    Buy = Ref(C,-1) > Ref(MA(C,13),-1) AND Ref(C,-1)<Ref(C,-2) AND Cross(H, O+((Ref(h,-1)-Ref(l,-1))*.55));
    Sell = Ref(C,-1) < Ref(MA(C,13),-1) AND Ref(C,-1)>Ref(C,-2) AND Cross( O-((Ref(h,-1)-Ref(l,-1))*.55),l);

    if( ParamToggle(“Exrem “, “No|Yes”, 0))
    {
    Buy = ExRem(Buy,Sell);
    Sell = ExRem(Sell,Buy);
    }

    if( ParamToggle(“Plot sig “, “No|Yes”, 1))
    {
    PlotShapes(Buy*shapeUpArrow, colorGreen, 0, Low, -10);
    PlotShapes(Sell*shapeDownArrow, colorRed, 0, High, -10);
    }

    stat = WriteIf(Buy,”Buy”,WriteIf(Sell,”Sell”,””));
    Filter = Buy OR Sell;

    AddTextColumn(stat, “Signal”, 1, colorblack, colorDefault);

    _SECTION_END();

    #95205 quote
    Nicolas
    Keymaster
    Master

    What do you want exactly about that code? This one plots only signals on the price charts depending of moving average conditions, it doesn’t trade automatically that signals.

    Please next time when asking for a code conversion, use this page and follow the rules: Ask for a free code conversion

    #95208 quote
    luckyhaa
    Participant
    Junior

    I want to trade and  backtest through  IG cfd pro real time  platform

    #95232 quote
    Nicolas
    Keymaster
    Master

    I think that this code is a correct conversion of the strategy:

    defparam cumulateorders=false
    
    c=close
    MA=average[13](c)
    buycross = high crosses over open+((high[1]-low[1])*.55)
    sellcross = low crosses under open-((high[1]-low[1])*.55)
    
    iBuy = C[1] > MA[1] AND C[1]<C[2] AND buycross
    iSell = C[1] > MA[1] AND C[1]<C[2] AND sellcross
    
    if ibuy and not longonmarket then 
    buy 1 contract at market
    endif
    
    if isell and not shortonmarket then 
    sellshort 1 contract at market 
    endif
    dax-backtest-moving-average-and-candle-ratio.png dax-backtest-moving-average-and-candle-ratio.png
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

moving average trading system MetaStock conversion request


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
luckyhaa @cjdevasia Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Nicolas
6 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/31/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...