traslate TS per prorealtime

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #21390 quote
    papero76
    Participant
    Senior

    input: IsFib(true), NBarsL(4), NBarsS(4), StopLossLong(0), StopLossShort(0), GoLong(true), GoShort(true), giornoL(0), giornoS(0), EndLong(2000), EndShort(2000);
    var: TradeShort(false), TradeLong(false), BarsToday(0), LastPrecTimeBar, dateprec;

    // giornoL e giornoS:
    // 1: lunedì
    // 5: venerdì

    if isFib then
    LastPrecTimeBar = 1715; //17:15 perchè è la penultima barra a 15 minuti, l’ultima è la 17:30
    else // DAX
    LastPrecTimeBar = 2130; //21:30 perchè è la penultima barra a 15 minuti, l’ultima è la 21:45
    endif;

    If getdatedaily <> dateprec then
    BarsToday = 0;
    TradeShort = false;
    TradeLong = false;
    dateprec = getdatedaily;
    endif;

    BarsToday = BarsToday + 1;

    If GoLong = True then
    If BarsToday = NBarsL and opend(0)< lowd(1) and (dayofweek <> giornoL) {and c > opend(0)and closed(1) > closed(3)} then
    TradeLong = true;
    endif;
    If StopLossLong > 0 then
    Installstoploss(INMON, StopLossLong, “STOP”); // Se il sistema perde l’equivalente di “StopLossLong” Euro, allora chiude la posizione
    endif;
    If TradeLong = True and BarsToday > NBarsL and T < EndLong and C < lowd(1) then
    EnterLong(nextbar, lowd(1), stop);
    endif;
    endif;

    If GoShort = true then
    If BarsToday = NBarsS and opend(0) > highd(1) and dayofweek <> giornoS then
    TradeShort = true;
    endif;
    If StopLossShort > 0 then
    Installstoploss(INMON, StopLossShort, “STOP”); // Se il sistema perde l’equivalente di “StopLossShort” Euro, allora chiude la posizione
    endif;
    If TradeShort = True and BarsToday > NbarsS and T < EndShort and close > highd(1){and closed(1) < closed(3)} then
    EnterShort(nextbar, highd(1), stop);
    endif;
    endif;

    // Setexitonclose; // esci da tutto a fine giornata
    if T = LastPrecTimeBar then
    // Esci in apertura dell’ultima candela,
    // visto che in realtime non posso uscire in chiusura dell’ultima barra del giorno
    ExitLong(nextbar, atopen);
    ExitShort(nextbar, atopen);
    endif;

    {*******************************************************************
    Description : Volume Flow Indicator.
    The rationale is similar to the
    On Balance Volume. (Ads Volume for up days and subtracts for
    down days).
    Reference: Markos Katsanos S&C Article, June 2004 Issue, pag 41
    Code modified and consolidated in a signle indicator because
    the original code doesn’t work on TS2000i
    TO BE USED WITH DAILY DATA
    Codifica di Paolo Arena (c) Copyright 2008, in allegato al libro
    “Il trading automatico” di Enrico Malverti

    ********************************************************************}
    Input: Coef(0.2), VCoef(2.5), Period(128), EmaBB(3), MavBB(50);

    Var: TP(0), Inter(0), VInter(0), CutOff(0), VAve(0), VMax(0), VC(0), MF(0), VFI(0),
    DirectionalVolume(0), DVNeg, oVFI(0), EmaVFI(0), MavVFI(0), MyVolume(0), Indzona1, Line0,
    NCutOff, NVC, ColoreVfi, MiaSum, IdOgg1(NEWOGG);

    // linea dello zero, per plottarla devo fare un vettore con tutti zeri
    Line0 = Constval(0);

    // typical price = (C + H + L) /3
    TP = OP(OP(OP(C, L, Add), H, Add), constval(3),divis);
    MF = OP(TP, Ref(TP,1), sub);
    VAve = REF(mov(V, Period, S), 1);

    Inter = OP(OSC_LOG(TP,10),OSC_LOG(ref(TP,1),10),sub);
    VInter = StdDev(Inter, 30, 0);

    CutOff = OP(OP(constval(Coef), VInter, Mul), C, Mul);
    NCutOff = OP(CutOff, constval(-1),Mul);

    VMax = OP(VAve, Constval(VCoef), Mul);
    VC = OSC_CompareValues(V, VMax, L, V, VMax); // if V < VMax -> V, altrimenti VMax
    NVC = OP(VC, constval(-1), Mul);

    DVNeg = OSC_CompareValues(MF, NCutOff, L, NVC, constval(0));

    DirectionalVolume = OSC_CompareValues(MF, CutOff, G, VC, DVNeg); // if V < VMax -> V, altrimenti VMax

    MiaSum = SUM(DirectionalVolume, Period);

    VFI = OP(MiaSum, VAve, Divis);

    EmaVFI = MOV(VFI, EmaBB, E);
    MavVFI = MOV(VFI, MavBB, S);

    if VFI > 0 then
    ColoreVfi = Green;
    else
    ColoreVfi = Red;
    endif;

    If crossover(VFI, Line0) then
    IdOgg1 = DrawText(IdOgg1, 0, D, H, “Vfi Crossover 0”, 0, green, 8, 1+4, 1);
    //enterlong(nextbar, atopen);
    endif;
    if MavVFI < MAVVFI[1] and MAVVFI[1] > MAVVFI[2] then entershort(nextbar, atopen);
    endif;
    if crossunder(VFI, Line0) then
    IdOgg1 = DrawText(IdOgg1, 0, D, H, “Vfi Crossunder 0”, 0, red, 8, 1+4, 1);
    //entershort(nextbar, atopen);
    endif;
    if MavVFI > MAVVFI[1] and MAVVFI[1] < MAVVFI[2] then enterlong(nextbar, atopen);
    endif;

    // creo una nuova zona e plotto tutte le linee
    Indzona1 = CreateViewport(500, true, true);
    PlotChart(VFI, Indzona1, ColoreVfi, solid, 2);
    PlotChart(EmaVFI, Indzona1, green, solid, 2);
    PlotChart(MavVFI, Indzona1, blue, solid, 2);
    DrawHLine (NEWOGG, indzona1, Line0, fuchsia, 2, 0); // linea dello zero

    #21397 quote
    Nicolas
    Keymaster
    Master

    ?

    #21402 quote
    ALE
    Moderator
    Master

    Buongiorno Papero,

    Credo che Nicolas a breve ti  aiuterà, vorrei però farti presente che Nicolas non è pagato per rispondere a tutte le richieste, e tutto il supporto che ci da lo fa per passione, per tanto nel forum chiedo a Te come a Tutti gli altri di porre le domande gentilmente, e senza pretese.
    Capisco che per motivi di tempo hai postato velocemente il codice, però cerchiamo di mantenere alto il livello di rispetto nei confronti di tutta la comunità, e sopratutto non dimentichiamoci che Nicolas è umano, è un “Buongiorno”, un”per favore”, un “Grazie” sono il minimo.

     

    Grazie per la comprensione,
    Buon lavoro

    #21437 quote
    papero76
    Participant
    Senior

    Ale , hai colto in pieno “fretta”

    mi scuso con la comunity per la mancanza del saluto, e con Nicolas

    #21505 quote
    Nicolas
    Keymaster
    Master

    Ok, quindi possiamo avere maggiori dettagli di ciò che questo copia / incolla è tutto ora? Grazie.

    #21613 quote
    papero76
    Participant
    Senior

    ciao a tutti, Nicolas non so cosa sia questo

    l’ho preso da un sito russo e il russo non lo parlo

    #21623 quote
    Nicolas
    Keymaster
    Master

    Mi dispiace, ma io davvero non capisco il motivo per cui si desidera che qualcuno traduce i codici che non sai nemmeno cosa che dovrebbe essere …
    Se ti fa felice, è possibile copiare / incollare tutto quello che troverete su questo sito russo sul computer, non sul nostro forum, a meno che non sai già che cosa è lo scopo del codice e sarà utile a voi. Grazie in anticipo 🙂

    #21774 quote
    papero76
    Participant
    Senior

    dovrebbe essere un trading system per forex

    #21820 quote
    ALE
    Moderator
    Master

    Ciao

    Tu sai se ha mai avuto dei buoni risultati?

    Grazie

    Ale

    #21843 quote
    papero76
    Participant
    Senior

    dal forum russo ho visto immagini (backtest) piacevoli, ora lo volevo testare con PRT

    purtroppo essendo un forum russo non ho salvato il link e ora devo perdere tempo a ricercarlo

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

traslate TS per prorealtime


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
papero76 @papero76 Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by papero76
9 years ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 01/16/2017
Status: Active
Attachments: No files
Logo Logo
Loading...