Intraday – Code to detect lack of bar

Forums ProRealTime English forum ProOrder support Intraday – Code to detect lack of bar

Viewing 8 posts - 1 through 8 (of 8 total)
  • #122951

    Good evening everyone,
    as in the attached screenshot (1 minute timeframe), I would like to insert in the code not to go in a long position if a price has not been formalized / there is no bar in the frames prior to the purchase (frames indicated in the red circle).
    How can the sw take over that there is no slash?

    Thanks a lot for those who want to give me a tip!

    #122953

    I don’t know if i well understood your question, but i try to make a guess.

     

    #122960

    Please do not double post.

    I will delete the other one.

    If markets are closed then no bar will appear. If they are open you can tell if there is a bar or not if close=open and there are no shadows. Open, High, Low and Close will all have the same price.

    #123321

    I would like that in case of lack of slash (candle), the sw did not go long. I tried to write the following code but nevertheless the sw continues to go long. Where am I wrong?

    In attachment I send the screenshot of the functioning of my code. Where there is the vertical red line, in that minute, there is no candle and therefore I would not want it to go long (as it does instead)

    Thank you very much!

     

    #123332

    As from your pic it seems there are no empty bars, just there are NO bars, so the entry bar (the red one) is simply the next one following the green bar.

    The attached pic shows empty bars (the one you want to skip) circled, while NO bars (which you cannot detect since they are NOT bars) in a rectangle. In your case your bars were like those in the rectangle, simply there was none!

    You should always let us know:

    • instrument traded (FX pair, Indices, stocks….)
    • TF used
    • date & time of involved candlesticks

    to be able to check and replicate your trades.

    #123336

    Exactly, that was what I was trying to explain to you.

    I don’t want to go long when there are no bars (rectangles in your image) in the previous minutes, is that possible?

    What does TS mean?

    #123341

    TF  = Time Frame (1 minute, 4 hours, Daily, ec…).

    Indeed it does not enter on a NON-existing candle, it enters the next candle, as usual.

    If your conditions are met on the last candle on Friday,  a trade will be opened on Monday (or Sunday) when the markets re-open.

    #123364

    Code is read at Close of your big green candle and order is launch at next bar Open. At Close of the green bar, there is no way to know what happen next, so the order is logically opened at next opening bar.

Viewing 8 posts - 1 through 8 (of 8 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login