DaynTrading
Members+-
Content Count
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Member Map
Everything posted by DaynTrading
-
I'm having troubles getting this to work while testing this in the TR account (paper trading). I've built out the script from the excel sheet however I'm seeing an issue with the Stop Loss sent as a Trigger Order. Here's the script (broken onto new lines for readability): StopPrice=Price-0.01; DefShare=BP*0.99; Share=DefShare*0.333*Price*0.02; Price=Ask-Price+0.01; SShare=Share/Price; Share=DefShare-SShare; DefShare=DefShare+SShare; SShare=Share; Sshare=DefShare-SShare; Share=0.5*SShare; TogSShare; ROUTE=LIMIT; Price= Ask+0.05; TIF=DAY+; BUY=Send; DefShare=100; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.19 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+; My steps are: Double click on chart Press Hotkey What I see happening: Double clicking on chart sets the Price in the Montage Pressing Hotkey my primary order is entered with the correct share size The trigger order status is Failed Within the Event Log > Trade Tab, I see: 10:00:34 TradeLog Sending,Buy,TOMZ,164,1.68,SMAT,10:00:35,REDACTED,,,Oid:38338 10:00:34 TradeLog Accept,Buy,TOMZ,164,1.68,SMAT,10:00:35,REDACTED,,L,Oid:38338 10:00:34 TradeLog Execute,Buy,TOMZ,164,1.63,SMAT,10:00:35,REDACTED,,L,Oid:38338 Within the Event Log > Trigger Tab I see: 10:00:34 TriggerLog Accept, F=38338, NEWORDER ACC:REDACTED ACT:SELL SYM:TOMZ EXH:Q QTY:POS RT:STOP PX:1.6 StopType:MARKET StopPrice:, Untriggered, , , , mid:25 10:00:35 TriggerLog Update, F=38338, NEWORDER ACC:REDACTED ACT:SELL SYM:TOMZ EXH:Q QTY:POS RT:STOP PX:1.6 StopType:MARKET StopPrice:, Triggered, , Failed, No StopPrice defined, mid:25 This is the part that's confusing me. The script should be defining the StopPrice at the beginning with: StopPrice=Price-0.01; Then later using that variable: PX:StopPrice-0.19 ACT:SELL STOPPRICE:StopPrice Does anyone know what could be causing this issue or how I can correct it? My goal is to: Double click on chart Press Hotkey Primary Order is executed Stop Loss is sent based on the Price I double clicked on chart I thought that is how this would work based on this forum post/excel sheet. Thanks for taking a look!
- 588 replies
-
- 1
-
- scripts
- risk management
-
(and 3 more)
Tagged with: