Use of variable on old past candle?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #162488 quote
    wtftbk
    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
    Vonasi
    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
    wtftbk
    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
    wtftbk
    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.

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 wtftbk
4 years, 11 months ago.

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