Use of variable on old past candle?

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

    Hi, i want to use a variable on an old candle, example: i have my condition met on “today candle”, i want to save that candle higher price to use in the future, by example if a new candle breakout that old candle price, i can do another condition or take a trade. The problem is the old candle, can be at a different number of candle in past. So i dont know how many candle it can be in past.

    Thanks

    #162489 quote
    VonasiVonasi
    Moderator
    Master

    Your description is a little difficult to understand but do you mean?

    if (my conditions met on this candle) then
    myprice = high
    endif
    
    //buy at myprice
    if not onmarket and close < myprice then
    buy 1 contract at myprice stop
    endif
    
    //do something else if price > myprice
    if close > myprice then
    if (whatever you want to do or check next) then
    ...
    endif
    Midlanddave thanked this post
    #162492 quote
    wtftbkwtftbk
    Participant
    New

    Example: see on picture, my condition draw this arrow, so i want when a new candle in future will breakout this candle with that condition with a higher candle, then i can execute my other code.

    Hope my explanation is better

    thanks

    2021-02-23_16h46_19.png 2021-02-23_16h46_19.png
    #162495 quote
    wtftbkwtftbk
    Participant
    New

    The code you gived to me work good, thanks

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

Use of variable on old past candle?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
wtftbk @wtftbk Participant
Summary

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

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