EuroFX trading system convertion from PowerLanguage

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #245876 quote
    KVS
    Participant
    New

    Hi all,

    I would like to convert the attached trading system into ProBuilder code, for use in ProRealTime. The original system was build in MultiCharts using  PowerLanguage. I intend to trade this on the equivalent CFD via IG. As such, I would like the TakeProfit and Stoploss targets to use point values. I also expect to have to adjust the trade times.  I would greatly appreciate if you can also consider any efficiency improvements that could be applied to the script.

    Kind Regards

    Kane

    #245877 quote
    KVS
    Participant
    New

    Code attached in Word.

    #245946 quote
    JS
    Participant
    Senior

    The ‘problem’ with this system is that it includes many indicators (BB, EMAs, RSI, MFI, ADX), all of which need to be aligned with each other…

    // Parameters
    defparam cumulateorders = false
    
    TimeFrame(30 minutes)//,UpdateOnClose)
    
    BeginTime = 083000   // 08:30 London time
    EndTime = 203000    // 20:30 London time
    Len = 18
    Len2 = 28
    OB = 71
    OS = 20
    BBSD = 1.5
    emaLenLX = 27
    emaLenSX = 28
    adxLen = 5
    minChng = 0.1
    TakeProfit = 260
    StopLoss = 140
    MySize = 1
    
    // Indicators
    Avg=Average[Len](Close)
    UpperBB = Avg+Std[Len](Close)*BBSD
    LowerBB = Avg-Std[Len](Close)*BBSD
    emaLX = ExponentialAverage[emaLenLX](close)
    emaSX = ExponentialAverage[emaLenSX](close)
    rsiVal = RSI[Len2](close)
    mfiVal = MoneyFlowIndex[Len2]
    rsiMFI = (rsiVal + mfiVal) / 2
    adxVal = ADX[adxLen]
    adxPrev = adxVal[1]
    
    // Setup-condities
    BuySetup = close[1] < LowerBB[1] and rsiMFI < OS
    SellSetup = close[1] > UpperBB[1] and rsiMFI > OB
    
    inTimeWindow = (time >= BeginTime and time <= EndTime)
    
    // Entry Long
    if not longonmarket and inTimeWindow and BuySetup then
    if close > LowerBB and (adxPrev - adxVal) > minChng then
    buy MySize contracts at market
    EndIf
    
    // Entry Short
    if not shortonmarket and inTimeWindow and SellSetup then
    if close < UpperBB and (adxPrev - adxVal) > minChng then
    sellshort MySize contracts at market
    EndIf
    
    // Exit Long
    if longonmarket and close > emaLX then
    sell at market
    EndIf
    
    // Exit Short
    if shortonmarket and close < emaSX then
    exitshort at market
    EndIf
    // Order Management
    set target profit TakeProfit * pointvalue
    set stop Loss StopLoss * pointvalue
    EndIf
    EndIf
    
    GraphOnPrice UpperBB
    GraphOnPrice LowerBB
    GraphOnPrice emaLX
    GraphOnPrice emaSX
    Graph rsiVal
    Graph mfiVal
    Graph rsiMFI
    Graph adxVal
    Graph BuySetup
    Graph SellSetup
    
    robertogozzi, KVS and Iván González thanked this post
    #245961 quote
    KVS
    Participant
    New

    Thanks JS. Much appreciate your efforts with this conversion.

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

EuroFX trading system convertion from PowerLanguage


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
KVS @kvs Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by KVS
9 months, 3 weeks ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/14/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...