heikin-ashi with 0,5% risk

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #113852 quote
    spaanemtrading
    Participant
    Junior
    Hi. I am new to programming and have a ide i love to test. have tried to program it myself but i strugle with getting foult codes when trying to run back test. I have found some codes here that i have tried to copy and paste in to my code, with no luck. Would love to get some help wrighting the code for me, so i can play a round with it for a bit. The ide is on heikin-ashi red /green candle trade, i have found code for it here, but i cant get it to work when i try to put in my exstra cretirials. Hope someone will help a noobe out here:) Here comes the cratiria for the trade one for long trades and one for short trades. Mads

    Conditions to enter Long trade.

    -In DAX opning times:09:00-1730.

    -Only 1 open trade at the time.

    -Open limit order on level of close green candle after a red candle.

    -close of green candle have to be over sma 50-100-200

    -stop loss, on low  of signal candle or 1 bar before depends on witch is lowest.

    -risk 0,5% of capital so if capital size is 10 000E then risk is 50E per trade.

    Round down on how many contracts 1E Dax to by to have the same risk level.

    -When trade is 1R in profit, move stop to brake even.

    -Condision to exit long trade. Place limit level on the prise of close on first red candle.

    Conditions to enter short trade.

    -In DAX opning times:09:00-1730.

    -Only 1 open trade at the time.

    -Open limit order on level of close red candle after a green candle.

    -close of red candle have to be under sma 50-100-200

    -stop loss, on low  of signal candle or 1 bar before depends on witch is lowest.

    -risk 0,5% of capital so if capital size is 10 000E then risk is 50E per trade.

    Round down on how many contracts 1E Dax to by to have the same risk level.

    -When trade is 1R in profit, move stop to brake even.

    -Condition to exit long trade. Place limit level on the prise of close on first red candle.

    #113924 quote
    robertogozzi
    Moderator
    Master
    Please do not double post. Moreover, your second post was in the wrong support forum. I deleted it. Thank you 🙂
    #113927 quote
    GraHal
    Participant
    Master
    i have found code for it here, but i cant get it to work when i try to put in my exstra cretirials.
    I’m sure it would  be easier if you post the code you found (on here). Are the conditions in your original post … all of your extra criteria??
    spaanemtrading thanked this post
    #114079 quote
    spaanemtrading
    Participant
    Junior
    Here is the code that i found. it is a same code for shorting. But i cant get the code to work. and i also want a stoplos one the low of the signal bar or the bar prior, dependig witchs is the lowest. and i want it to go to brake even when it retch 1R. i also want a pending order on close prise of signal bar not a bay at marked order.
    // Heikin Ashi setup
    once xOpen = open
    xClose     = (open + close + high + low) / 4
    if barindex > 0 then
        xOpen  = (xOpen + xClose[1]) / 2
    endif
    xLow       = min(low,min(xClose,xOpen))
    xHigh      = max(high,max(xClose,xOpen))
    //
    Bullish = xClose > xOpen
    Bearish = xClose < xOpen
    // LONG  trades when switching from bearish to bullish
    IF Bullish AND Bearish[1] THEN
       BUY 1 CONTRACT AT MARKET
    ENDIF
    // exit LONG trade on a Bearish candlestick
    IF Bearish AND LongOnMarket THEN
       SELL AT MARKET
    ENDIF
    #114080 quote
    robertogozzi
    Moderator
    Master
    @spaanemtrading >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text from the code part! Thank you! << 🙂
    #114081 quote
    spaanemtrading
    Participant
    Junior
    Ok. I will remember that, tank you:)
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

heikin-ashi with 0,5% risk


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/28/2019
Status: Active
Attachments: No files
Logo Logo
Loading...