ma 50 distance

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #218737 quote
    kvacksa87kvacksa87
    Participant
    Junior

    Hello i want help with automatic trade

    distance to ma50 in 3 minute graph. buy when price is 50 pips from ma50 and sell when it touches ma50 both long and short

    #218800 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    ma50 = average[50,0](close)
    IF Not OnMarket THEN
       IF close <= (ma50 - 50*PipSize) THEN
          BUY 1 Contract at Market
       ELSIF close >= (ma50 + 50*PipSize) THEN
          SELLSHORT 1 Contract at Market
       ENDIF
    ENDIF
    IF LongOnMarket THEN
       IF high >= ma50 THEN
          SELL at Market
       ENDIF
    ELSIF ShortOnMarket THEN
       IF low <= ma50 THEN
          EXITSHORT at Market
       ENDIF
    ENDIF
    graphonprice ma50 - 50*PipSize AS "Long trigger"  coloured("Green")
    graphonprice ma50 + 50*PipSize AS "Short trigger" coloured("Red")

    you may either comment out or remove the last two lines if you don’t need them.

    kvacksa87 thanked this post
    #219003 quote
    kvacksa87kvacksa87
    Participant
    Junior

    Thank you so mutch. I thought the last 2 lines were very good and useful. so I have a question for you if you can code so I take inputs on them instead? buy when the lowest price of the bar crosses below the green line and short when it crosses up the red

    PSX_20230813_210927.jpg PSX_20230813_210927.jpg
    #219343 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    What is the green line, how is it formed?

Viewing 4 posts - 1 through 4 (of 4 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

ma 50 distance


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
kvacksa87 @kvacksa87 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
3 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/08/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...