EMA with a horizontal and verticle shift

Viewing 15 posts - 1 through 15 (of 28 total)
  • Author
    Posts
  • #193061 quote
    josward1
    Participant
    New

    How would i code an EMA 3 with a 1 bar horizontal shift and a 0.034 verticle shift?

    #193071 quote
    JS
    Participant
    Veteran

    y = ExponentialAverage[3](close[1]) + 0.034
    Return y

    #193074 quote
    josward1
    Participant
    New

    thanks, and if i wanted a verticle shift down would it be

     

    ExponentialAverage[3](close[1]) – 0.034  ?

     

    also does return y needed to be coded underneith? if i was coding using ema3 as the name should it be this…

    ema3 = ExponentialAverage[3](close[1]) + 0.034

    return ema3

    #193076 quote
    JS
    Participant
    Veteran

    True, plus (+) is a positive vertical shift and minus (-) is a negative vertical shift.

    You can use any name you want.

    #193079 quote
    josward1
    Participant
    New
    thanks, is it necessary to put “return ema3” under the line?
    #193080 quote
    JS
    Participant
    Veteran

    An indicator must be closed with RETURN

    Return EMA3 will show the values of the EMA3 in the graph.

    #193106 quote
    josward1
    Participant
    New
    Thanks, I have done this: ema3 = ExponentialAverage[3](close[1]) + 0.034 return ema3   and the return is underlined red showing an error
    #193107 quote
    JS
    Participant
    Veteran

    Do you use the above line in an automatic trading system?

    #193113 quote
    JS
    Participant
    Veteran
    Example Trading System with EMA3 EMA3Plus = ExponentialAverage[3](close[1]) + 0.034 EMA3Min = ExponentialAverage[3](close[1]) – 0.034 If Close Crosses Over EMA3Plus then Buy 1 contract at market ElsIf Close Crosses Under EMA3Min then SellShort 1 contract at market EndIf Graph EMA3Plus as “EMA3Plus” Graph EMA3Min as “EMA3Min”
    #193127 quote
    josward1
    Participant
    New
    yes its is to detect conditions for one line bing over the other by a set distance.  I have the code i’m just looking to find the correct way to set up the verticle and horizontal shift. The return was new to me but showed up as an error when i tried to implement
    #193133 quote
    JS
    Participant
    Veteran

    Have you already optimized your system?

    #193179 quote
    josward1
    Participant
    New
    Yeh I’m just experimenting with different ways of setting up the averages
    #193393 quote
    MIKE PAPY
    Participant
    New
    moi j’aimerais pouvoir déplacer horizontalement un indicateur quelconque vers la gauche ou la droite I would like to be able to horizontally move any indicator to the left or to the right
    #193417 quote
    robertogozzi
    Moderator
    Master
    @MIKE PAPY Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums. Please abide by the rules highlighted in yellow (below). Thank you 🙂
    #193418 quote
    robertogozzi
    Moderator
    Master
    With RETURN you can only move the indicator to the left, i.e. the past value is plotted currently (not in the future, though), such as:
    Sma = Average[20,0](close)
    RETURN Sma[1]
    you cam shift both ways using graphic instructions (DrawSegment) by: – repainting current data into the past – plotting cuurrent data into the future. In any case each indicator must be programmed to behave this way.
Viewing 15 posts - 1 through 15 (of 28 total)
  • You must be logged in to reply to this topic.

EMA with a horizontal and verticle shift


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
josward1 @josward1 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/11/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...