Intraday – Code to detect lack of bar
Forums › ProRealTime English forum › ProOrder support › Intraday – Code to detect lack of bar
- This topic has 7 replies, 4 voices, and was last updated 5 years ago by
Nicolas.
-
-
03/22/2020 at 7:45 PM #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!
03/22/2020 at 7:58 PM #122953I don’t know if i well understood your question, but i try to make a guess.
123456EntryOnlyIf1= close>close-1EntryOnlyIf2= close<close-1if yourconditions and EntryOnlyIf1 and EntryOnlyIf2then buy\sellshort n contracts at marketendif03/22/2020 at 9:21 PM #122960Please 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.
03/25/2020 at 11:10 PM #123321I 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!
123456789101112// Definition of code parametersMyRange = RangeDojistretta = (Open=Close)Assenzadicandela = (High = Low)REM Vai LONG se:// - se non c'è una doji ristretta o con range nullo nella posizione precedente all'acquisto// - non siamo oltre le 17.20// allora vai longIF NOT LONGONMARKET AND MyConditions AND NOT MyRange = 0 AND NOT DOjistretta AND NOT Assenzadicandela THENBUY 1000 SHARES AT MARKETENDIF03/26/2020 at 12:35 AM #123332As 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.
03/26/2020 at 12:47 AM #12333603/26/2020 at 1:03 AM #123341TF = 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.
03/26/2020 at 10:05 AM #123364 -
AuthorPosts
Find exclusive trading pro-tools on