SISTEMI INTERROTTI DOPO MEZZANOTTE

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #238381 quote
    Gaspare
    Participant
    Veteran
    //PRC_AlphaTrend | Trading system
    DEFPARAM CumulateOrders = false
    defparam preloadbars = 10000
    Defparam Flatbefore=080000
    Defparam Flatafter=220000
    
    ONCE A = 22.0
    ONCE C = 2.0
    ONCE M = 13.0
    MHull  = average[ M ,7](close)
    Bullish = MHull > MHull[1] and MHULL[1]  < MHULL[2]
    Bearish = MHull < MHull[1] and MHULL[1]  > MHULL[2]
    
    AP = A //Common Period
    coeff = C //Multiplier
     
    if (MoneyFlowIndex[ap]>=50) then
    magic=Low[0]-AverageTrueRange[ap](close)*coeff
    endif
     
    if (MoneyFlowIndex[ap]<50) then
    magic=High[0]+AverageTrueRange[ap](close)*coeff
    endif
     
    if (MoneyFlowIndex[ap]>=50 and magic<magic[1]) then
    magic=magic[1]
    endif
     
    if (MoneyFlowIndex[ap]<50 and magic>magic[1]) then
    magic=magic[1]
    endif
     
    if magic>magic[1] then
    Flag=1
    elsif magic<magic[1]then
    flag=0
    endif
    
    if NOT OnMarket and Bullish and magic>magic[1] and flag<>flag[1]   then
    Buy 0.2 contract at Market
    
    EndIf
     
    If NOT OnMarket and Bearish and magic<magic[1]and flag<>flag[1]  then
    SellShort 0.2 contract at Market
    
    endif
     
    SET STOP pLOSS      100
    //SET TARGET pPROFIT  20
    //trailing stop function
    trailingstart = 50 //trailing will start @trailinstart points profit
    trailingstep = 25 //trailing step to move the "stoploss"
     
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
     
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
     
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
     
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    

    Ciao Roberto

    non capisco perchè alcuni sistemi vengono interrotti da ProOrder

    all’inizio della prossima giornata di borsa anche se tutto mi sembra regolare

    Cliccando sul triangolo giallo compare la schermata allegata

    che mi chiede DEFPARAM preloadbars = 10000

    ma la riga è gia’ presente nello sviluppo del sistema

    Grazie

    #238414 quote
    robertogozzi
    Moderator
    Master

    Ti prego di evitare di scrivere interamente in MAIUSCOLO, anche se solo per il titolo, in quanto la NETIQUETTE scoraggia l’uso di lettere tutte maiuscolo, se non eccezionalmente per mettere enfasi su una specifica parola.

    L’uso della MAIUSCOLE è considerato scortese in quanto è equiparato ad “urlare” per farsi sentire in mezzo ad altri.

    Grazie per la collaborazione 🙂

    #238422 quote
    robertogozzi
    Moderator
    Master

    Non saprei, il codice mi sembra corretto.

    L’unico tentativo è provare a togliere i decimali dalle variabili A, C ed M, mettendo solo 22, 2 e 13.

    #238431 quote
    Gaspare
    Participant
    Veteran

    chiedo scusa, ma ho sempre scritto in maiuscolo il titolo

    nessun problema a scrivere minuscolo e tanto meno a essere scortese

    grazie togliero’ i decimali

    ciao

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

SISTEMI INTERROTTI DOPO MEZZANOTTE


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Gaspare @gaspare Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Gaspare
1 year, 4 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 10/01/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...