Codice breakeven chiarimento

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #145215 quote
    danistutadanistuta
    Participant
    Senior
    //Break even
    breakevenPercent = 830
    PointsToKeep = 4
    startBreakeven = tradeprice(1)*(breakevenpercent/100)
    
    once breakeven = 1//1 on - 0 off
    //reset the breakevenLevel when no trade are on market
    if breakeven>0 then
    IF NOT ONMARKET THEN
    breakevenLevel=0
    ENDIF
    // --- BUY SIDE ---
    //test if the price have moved favourably of "startBreakeven" points already
    IF LONGONMARKET AND close-tradeprice(1)>=startBreakeven*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice(1)+PointsToKeep*pipsize
    ENDIF
     
    //place the new stop orders on market at breakevenLevel
    IF breakevenLevel>0 THEN
    SELL AT breakevenLevel STOP
    ENDIF
    // --- end of BUY SIDE ---
     
    IF SHORTONMARKET AND tradeprice(1)-close>startBreakeven*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice(1)-PointsToKeep*pipsize
    ENDIF
    //place the new stop orders on market at breakevenLevel
    IF breakevenLevel>0 THEN
    EXITSHORT AT breakevenLevel STOP
    ENDIF
    endif

    Ho preso questo codice da uno script per wall street, l’ho poi inserito su EUR/USD . Il valore originario della percentuale del breakeven era di “0.15” e non capisco come mai invece sul forex ho dovuto inserire valori molto più alti, tipo “890” per ottenere percentuali proporzionate…cosa mi sfugge nel codice? Mi piacerebbe inserire la percentuale corretta.

    Grazie mille.

    #145226 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Alla riga 14 e alla 25 togli PIPSIZE, in quanto è già un prezzo, non pips, quindi non va convertito startBreakeven.

    #145237 quote
    danistutadanistuta
    Participant
    Senior

    Grazie!:-)

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Codice breakeven chiarimento


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
danistuta @danistuta Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by danistutadanistuta
6 years ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/24/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...