Enable TimeFrames settings?
Forums › ProRealTime English forum › ProOrder support › Enable TimeFrames settings?
- This topic has 12 replies, 3 voices, and was last updated 3 years ago by Vonasi.
-
-
04/20/2020 at 9:49 PM #127131
Hi Everyone,
I have tested a code in the backtesting environment and it worked well.
when I tested it today in the proOrder autotrading it totally ignored my TimeFrame command
The code is something like this:
123456TIMEFRAME (30 minutes,updateonclose )//check cond and set signal 1 or -1TimeFrame(default)//if -1 do...//if 1 do ...I run it on a 1 min TF and at the end of every 1 min bar it gave me a new signal (instead of giving a new signal every 30 min)
I read in the forum a question about it in 2018 and it said TF will be enabled soon. so I guess they are long live by now, but this is my first attempt with them (so far I love them!)
04/20/2020 at 11:11 PM #127140That’s correct, if you run it from 1-minute TF it may enter 30 times.
You have to write code non to!
If you post an idea I may help you.
1 user thanked author for this post.
04/20/2020 at 11:19 PM #12714304/21/2020 at 12:39 AM #127146You can use anything in real trading, provided it is used correctly!
Examples (both tested on DAX, 1-minute chart):
1 - Multiple entries for the same signal1234567891011// This version may enter severeal times on the same signal//DEFPARAM CumulateOrders = falseTIMEFRAME(4 hour,UpdateOnClose)CrossOver = close crosses over average[10]TIMEFRAME(default) //say 1-minute TFif CrossOver and Not OnMarket thenbuy at marketendifset stop pLoss 20set target pProfit 402 - One entry only per signal12345678910111213141516// This version may enter only once on the same signal//DEFPARAM CumulateOrders = falseTIMEFRAME(4 hour,UpdateOnClose)CrossOver = close crosses over average[10]TIMEFRAME(default) //say 1-minute TFONCE TradeON = 0IF CrossOver AND Not CrossOver[1] THENTradeON = 1Endifif CrossOver AND Not OnMarket AND TradeON thenbuy at marketTradeON = 0endifset stop pLoss 20set target pProfit 401 user thanked author for this post.
04/21/2020 at 12:41 AM #127147It’s basically the same code, but I have added some code, in te latter, to avoid re-entering on the same signal.
You can do (almost) anything using the correct code to!
1 user thanked author for this post.
04/21/2020 at 1:05 AM #127150Thanks,
But I’m still confused. what is not “correct” with the code I tried, that worked in the test environment?
Just to be clear, the TimeFrame 30 is chaging the MyRSI paremeter every minute. one bar it sets it to buy, the next to sell again and again. whereas the plan is to set the MyRSI once every 30 minutes and get into a trade (or leave it) when the other conditions are met.to put it simply: I don’t understand why it would change the myRSI signal every minute not every 30 min. again, in test it works fine only in the proauto trading platform it does not. which led me to believe the problem is in the settings.
1234567891011121314151617181920212223242526272829303132//this should occur only every 30 min - but in fact this is activated every minute on a 1min TFTIMEFRAME (30 minutes,updateonclose )MyRSI = RSI[5](close)IF MyRSI>50 THENSignal = 1ELSIF MyRSI<50 THENSignal=-1ENDIF//this should occur every minuteTimeFrame(default)IF Signal = 1 THENIF SHORTONMARKET THENEXITSHORT AT MARKETBUY StakeSize CONTRACTS AT high+EntryBuffer stopSET STOP LOSS high-low+2*EntryBufferELSIF NOT ONMARKET THENBUY StakeSize CONTRACTS AT high+EntryBuffer stopSET STOP LOSS high-low+2*EntryBufferENDIFENDIFIF Signal = -1 THENIF LONGONMARKET THENSELL AT MARKETSELLSHORT StakeSize CONTRACTS AT low-EntryBuffer stopSET STOP LOSS high-low+2*EntryBufferELSIF NOT ONMARKET THENBUY StakeSize CONTRACTS AT low-EntryBuffer stopSET STOP LOSS high-low+2*EntryBufferENDIFENDIF04/21/2020 at 2:39 AM #127157No, UpdateOnClose will allow changing MyRsi when the 30-minute candle closes.
04/21/2020 at 2:43 AM #127158Append
1GRAPH MyRsito your code to monitor its value each 1-minute candle in the variable window opened by ProBackTest.
04/21/2020 at 8:28 AM #127179I think that is the problem.
in the test environment I used GRAPH of course, and it works fine.
In the AutoTrading environment I can’t use GRAPH and it doesn’t work as intended.
There is something basic here that I seem t be missing.
04/21/2020 at 9:58 AM #12719004/21/2020 at 10:28 AM #127199How do you know it changes every minute?
1 user thanked author for this post.
04/25/2020 at 9:29 PM #12808804/25/2020 at 9:56 PM #128095aland – Not sure how this topic went quite so far without anyone spotting that you posted it in the wrong forum but you did! ProBuilder where you posted it is is for indicator topics and ProOrder is for strategy topics. I will move this topic but please try to post in the correct forum with any future topics.
-
AuthorPosts
Find exclusive trading pro-tools on