How to ignore Code?
Forums › ProRealTime English forum › ProOrder support › How to ignore Code?
- This topic has 5 replies, 4 voices, and was last updated 7 years ago by GraHal.
-
-
08/12/2016 at 7:34 PM #11633
Is there a term I can insert in a line of code so that the code that follows is ‘ignored’ until the next ‘ignore’ is noted?
Example:
IF barindex – tradeindex = 55 OR POSITIONPERF < – 0.01 ignore OR POSITIONPERF > 0.051 ignore THEN …
I know I can ‘comment out’ the expression but I then have to move the expression to a separate line.
I want to leave the expression in the line of code run Backtest and then remove the ignore terms and run backtest again.
Thanks
GraHal
08/12/2016 at 10:14 PM #11639I don’t know if this will help, but I use a different approach. I use some switches like this so I don’t have to REMove some of the code. When dealing with several different code you want to switch between I find this very fast to do.
Cheers
Kasper
1234567sw1=1if Sw1=1 thenbarindex - tradeindex = 55 OR POSITIONPERF < - 0.01elsebarindex - tradeindex = 55 OR POSITIONPERF < - 0.01 OR POSITIONPERF > 0.051endif1 user thanked author for this post.
03/06/2017 at 2:20 PM #27327Good Morning @Elsborgtrading @GraHal
In another programming platform I use an instruction ( “Tradedelay = 1”) to indicate that my position must be opened in the next bar / candle / period (according to conditions not fullfiled in the first bar/candle).
What would be the equivalent function in ProRealTime?, in other words i want to verify certain conditions in the next bar/candle and re-assess so my system can open a position either short or long.
Could i use Openminute? or Open-1 ?
Code:
1234567891011121314151617181920212223DEFPARAM CumulateOrders = FalseDEFPARAM FLATBEFORE = 090000DEFPARAM FLATAFTER = 150000indicator1 = Average[9](Sthocastic[14](open))c1 = (indicator1 > indicator1[1])indicator2 = SAR[0.03,0.02,0.2]c2 = (indicator2 > indicator2[1])c1ABS = ABS(indicator1 > indicator2[1])c2ABS = (indicator2 > indicator2[1])IF (c1ABS AND c2ABS) THENBUY 1 CONTRACT AT MARKETELSIF (C1ABS AND C2ABS)Open-1 THENBUY 1 CONTRACT AT MARKETENDIFENDIFI thank you ind advance as always for your contributions.
Greetings and good trading
04/12/2017 at 10:06 AM #31830Hi David
I just noticed this, but I’m not clear what you want, sorry?
You say … i want to verify certain conditions in the next bar/candle and re-assess so my system can open a position either short or long … PRT checks / verifies coded conditions at the end of every bar / candle and then takes a Long or Short at the start of the next bar if conditions were fulfilled in the last bar.
Hope above helps?
GraHal
04/12/2017 at 11:22 AM #31848Another option:
1barindex - tradeindex = 55 OR POSITIONPERF < - 0.01 OR POSITIONPERF > 0.051may become
1barindex - tradeindex = 55 OR POSITIONPERF < - 0.01 //OR POSITIONPERF > 0.05104/12/2017 at 3:26 PM #31863 -
AuthorPosts
Find exclusive trading pro-tools on