Start of Pro Order Autotrade looks at previous historical candle
Forums › ProRealTime English forum › ProOrder support › Start of Pro Order Autotrade looks at previous historical candle
- This topic has 11 replies, 4 voices, and was last updated 4 years ago by
Alun.
-
-
12/29/2020 at 8:38 PM #15561512/29/2020 at 9:43 PM #155621
I think ProOrder does what you say by default. If you have a daily timeframe and you start your robot at noon, your robot wont do anything before midnight, even if the buy conditions were met at midnight the day before.
Maybe another member can confirm what I say.
12/30/2020 at 11:10 AM #15566412/30/2020 at 8:56 PM #155737When I started my code, there was already a daily green candle >8ema completed on the chart from the previous day. It looks like the code (or robot) read the previous green candle as >8ema even though the first candle after starting the code was a red candle closing below the 8ema. The code looks for Open>8ema[1], Close>8ema[1] and Close>Open.
I am not sure why the code seems to have read the previous candle as satisfying my code criteria, and executed a buy at market above the first red candle.
12/30/2020 at 10:07 PM #155743When I started my code, there was already a daily green candle >8ema completed on the chart from the previous day.
The first two conditions below fit the scenario above and so a trade would execute (at the open of the next candle) if Close > Open on the current candle?
Open>8ema[1], Close>8ema[1] and Close>Open.
code to ignore the previous candle close condition when it first starts?
To get above, you would need your code written as …
123If Open>8ema[0] AND Close>8ema[0] and Close>Open ThenBuy at MarketEndifLet us know if it works?
12/31/2020 at 12:40 AM #155749Providing this is a valid expression, would the IF criteria “Today[0] > 202012029” prevent the code from using the candle before the code started.
OR
Is there a slight “bug” going on where the code has been triggered just before the start of the new candle? Should I start the code at a time (5 or 10 minutes) just after the market has opened to allow the first candle to start forming to avoid this issue?
12/31/2020 at 12:46 AM #155750Thank you GraHal for your suggestion. I would like the current candle to open and close > the previous 8ema (not the current 8ema):-
Open>8ema[1] AND Close>8ema[1] and Close>Open
So I want the code to use the candle that appears after starting the code (not the candle before the code started) and compare the Open and Close to the previous 8ema.
12/31/2020 at 11:36 AM #1557721Open > ExponentialAverage[8](close) AND Close > ExponentialAverage[8](close) AND Close > OpenAre you saying you want the above to be read at end of the candle following the candle on which you start your code?
EDIT / PS
NOTE: In the above condition, EMA is for 8 periods and so will use candle values for the previous 7 candles + the candle value of the candle on which the code is read, i.e. the current candle.12/31/2020 at 2:02 PM #155782Apologies if my explanations are confusing. Here is the code and a screen shot (see the attachment) of what actually happened. I started the autotrade code at 22:15 on 28th Dec on the daily timeframe after the Inverted Hammer had formed (d’ly). The next day it immediately opened a position at 88.8 – it took the previous days’ inverted hammer candle as satisfying the criteria below when the market opened the following day on 29th Dec. The light blue line is the 8ema.
Is it possible to have the code ignore the previous days candle only when the code starts (but not on subsequent days after the code continues to run)?
123456789// Conditions to enter long positionsindicator1 = ExponentialAverage[8](close)c1 = (close > indicator1[1])c2 = (open >= indicator1[1])c3 = (close > open)IF c1 AND c2 AND c3 AND NOT onmarket THENBUY X PERPOINT AT MARKETENDIF12/31/2020 at 2:52 PM #15579612/31/2020 at 2:58 PM #155799Your description is confusing. Your strategy did what is normal. All code is read through at the close of a candle and orders sent to the market at the open of the following candle. So if at the close of the first candle your entry conditions are met your trade will open at the opening of the following candle. If you want to skip a candle then just start a count and don’t trade until it is 2.
1234567891011count = count + 1// Conditions to enter long positionsindicator1 = ExponentialAverage[8](close)c1 = (close > indicator1[1])c2 = (open >= indicator1[1])c3 = (close > open)IF c1 AND c2 AND c3 AND NOT onmarket and count >= 2 THENBUY X PERPOINT AT MARKETENDIF1 user thanked author for this post.
12/31/2020 at 3:22 PM #155801 -
AuthorPosts
Find exclusive trading pro-tools on