Heikin Ashi Smooth

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #144777 quote
    bearbull
    Participant
    Average

    I use the Heikin Ashi Smooth as a moving average and want to incorporate it into a system.

    I want to code buy and sell signals based on the Heikin Ashi smooth.

    Buy when first green Heikin Ashi smooth appears and closes, after a succession of red Heikin Ashi smooth.

    This to be irrespective of where price action candles are on the chart.

    I will concentrate on the buy side and then move onto developing the sell side.

    Attached is a screen shot of the red Heikin Ashi eventually closing green……..the setting price in the back ground is Line + points.

    Any guidance on this first element would be very helpful.

     

    Many thanks

    #144779 quote
    bearbull
    Participant
    Average

    ……………I think I have found the code……

    #144806 quote
    bearbull
    Participant
    Average

    Ok I had a crack at the code using the simplified method of creating code……….

    Its telling me there is a syntax error in line 6 (as that has an exclamation mark in an orange triangle – LOL)

    Just trying to get it started in the first instance i.e. buy when Heikin Ashi Smooth candle turns green after a red candle………..although I only could think that you would have to state that the Heikin Ashi smooth indicator relevant

    candle would close above the open as I dont think you can program colour changes? is that correct?

    Any guidance would be a great help.

    Thanks.

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter long positions
    c1 = CALL "Heikin_Candle_smoothed"[21, 5, -2, 21, 0]
    > CALL "Heikin_Candle_smoothed"[21, 5, -2, 21, 0]
    [1]
    
    IF c1 THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    c2 = (CALL "Heikin_Candle_smoothed"[21, 5, -2, 21, 0]
    < CALL "Heikin_Candle_smoothed"[21, 5, -2, 21, 0]
    [1])
    
    IF c2 THEN
    SELL 1 PERPOINT AT MARKET
    ENDIF
    #144807 quote
    robertogozzi
    Moderator
    Master

    Lines 6 and 15 have more than one error each:

    • remove the initial “>”
    • use a variable to assign the returned value of the CALL.
    #144808 quote
    bearbull
    Participant
    Average

    Hi.

    Thanks for getting back.

    I dont understand     ‘use a variable to assign the returned value of the CALL.’

     

    thanks

    #144809 quote
    robertogozzi
    Moderator
    Master

    Because CALL returns a value and that value has to be stored somewhere, like in lines 5 and 14, so that you can compare them.

    You cannot use “>” to compare 2 different CALL and it cannot be written in separate lines.

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

Heikin Ashi Smooth


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
bearbull @bearbull Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/19/2020
Status: Active
Attachments: No files
Logo Logo
Loading...