How do I open a position in the first bar of a newly started trading system ?
Forums › ProRealTime English forum › ProOrder support › How do I open a position in the first bar of a newly started trading system ?
- This topic has 28 replies, 5 voices, and was last updated 6 years ago by Leo.
-
-
03/20/2018 at 7:35 AM #65790
of course, I just meant your concept.
You could say :
123If date = 20180320 and TIME = 073500 thenbuy 1 contract at marketendifto open a position in a system in the 1 minute chart that was started between 7:34 and 7:35 and will have its first bar at 7:35.
Agree ?
03/20/2018 at 7:59 AM #6579203/20/2018 at 9:01 AM #65800I have posted a system that opens a position exactly at last minute of opened markets.
As far I understand you want a code that opens a position exactly when it is activated and then controls the trade itself. I think is a very powerful tool for manual trading as default style of trading.
By the way, once I test a code that opens stop and limit orders symulstaniously. Then the first try I had a copy paste problem the result was that it opened a trade “exactly at the moment of activation not at the end of the bar closing. That means for me that prorealtime runs the systems at the moment of activation like running the code at every closing bar.
let us know your progress
03/20/2018 at 11:13 AM #65828to open a position in a system in the 1 minute chart that was started between 7:34 and 7:35 and will have its first bar at 7:35.
It would be a pain having to open the System in the coding window and then enter date and starting Time then back to the system running window then delete the old system (without current date and time) and also you would lose your Performance History. Or am I misunderstanding?
Yes Leo I am also thinking this Snippet could form part as a semi-manual entry, auto close trading Strategy.
Good Work Verdi55
GraHal03/29/2018 at 12:09 PM #6668003/29/2018 at 1:09 PM #66691Thanks. Or maybe we could say :
1234567If barindex = tradeindex thenflag = 1endifIf not onmarket and flag = 0 thenbuy 1 contract at marketendifThis would definitely open only 1 position, even if the result of the first position is accidentally zero.
04/10/2018 at 9:56 PM #67966Here my code. I was not able to open a position exactly when the system is activated rather it opens a position in the next bar.
My code is thought to be a standard
12345678910111213141516171819202122DEFPARAM CumulateOrders = false // Cumulating positions deactivatedDEFPARAM PreLoadBars = 100 //cargar informacionIF NOT ShortOnMarket THENBUY 1 CONTRACTS AT MARKETSET STOP pLOSS 15SET TARGET pPROFIT 30ENDIFMySAR= SAR[0.005,0.01,0.7]IF shortonmarket thenIF close crosses under MySAR THENEXITSHORT AT MARKETENDIFIF CLOSE-POSITIONPRICE > 7*PIPSIZE THENSET STOP pLOSS 1ENDIFENDIFIF shortonmarket[1] and not shortonmarket thenQUITENDIFmanual trade for me.
04/10/2018 at 10:13 PM #6796804/10/2018 at 10:24 PM #6796904/10/2018 at 10:26 PM #6797104/10/2018 at 10:29 PM #67972Maybe as an Italian, you will better understand this :
04/11/2018 at 6:21 AM #6798504/11/2018 at 6:40 AM #6798804/11/2018 at 7:05 AM #67991 -
AuthorPosts
Find exclusive trading pro-tools on