Do not trade a price range with losses from previous trades..
Forums › ProRealTime English forum › ProOrder support › Do not trade a price range with losses from previous trades..
- This topic has 9 replies, 2 voices, and was last updated 3 years ago by Fran55.
Viewing 10 posts - 1 through 10 (of 10 total)
-
-
11/08/2020 at 12:26 PM #14983011/08/2020 at 12:27 PM #14983111/08/2020 at 1:06 PM #149832
There you go (not tested):
12345678910111213141516Once PerCent = 0.10 //10%Once LOrange = 0Once HIrange = 9999999If StrategyProfit >= StrategyProfit[1] ThenLOrange = 0HIrange = 9999999EndifEntryConditions = 1EntryConditions = ((Not ((close >= LOrange) and (close <= HIrange))) And LOrange <> 0)If MyLongConditions and EntryConditions ThenBuy 1 contract at MarketSet Stop pLoss 100Set Target pProfit 100LOrange = close - (close * PerCent)HIrange = close + (close * PerCent)Endif11/08/2020 at 1:53 PM #14983511/08/2020 at 1:55 PM #149837The correct code is (still not tested):
1234567891011121314151617181920Once PerCent = 0.10 //10%Once LOrange = 0Once HIrange = 9999999If StrategyProfit >= StrategyProfit[1] ThenLOrange = 0HIrange = 9999999EndifEntryConditions = 1If LOrange <> 0 ThenIf ((close >= LOrange) and (close <= HIrange)) ThenEntryConditions = 0EndifEndifIf MyLongConditions and EntryConditions ThenBuy 1 contract at MarketSet Stop pLoss 100Set Target pProfit 100LOrange = close - (close * PerCent)HIrange = close + (close * PerCent)Endif11/08/2020 at 4:46 PM #14984411/08/2020 at 4:47 PM #14984511/09/2020 at 8:41 AM #14987811/09/2020 at 12:46 PM #149896I found the bug, this works (tested on Dax, Daily TF):
12345678910111213141516171819Once PerCent = 0.10 //10%Once LOrange = 0Once HIrange = 9999999EntryConditions = 1If LOrange <> 0 ThenIf ((close >= LOrange) and (close <= HIrange)) ThenEntryConditions = 0EndifEndifMyLongConditions = (Not OnMarket) AND (close > average[10,0](close))If MyLongConditions and EntryConditions ThenBuy 1 contract at MarketSet Stop pLoss 1000Set Target pProfit 1000LOrange = close - (close * PerCent)HIrange = close + (close * PerCent)Endif//graphonprice HIrange coloured(0,255,0,255)//graphonprice LOrange coloured(255,0,0,255)As you can see from the screenshot, the strategy stops trading, even if above average within the range, until it’s broken.
11/09/2020 at 5:41 PM #149930 -
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)
Find exclusive trading pro-tools on
Similar topics: