I am continuing to answer your specific requests from the summer survey.
14. I just like basic entry, with a stop and 2 price targets.
This comes down to splitting the stop and target to two orders. The only tricky part is to calculate the position size properly. Like if you have 121 shares, POS/2 will give you 61 (60.5 rounded up) while the rest is 60
Long hotkey
$MONTAGE=GetWindowObj("MONTAGE1");
$MONTAGE.CXL ALLSYMB;
$buyprice=$MONTAGE.Ask;
$risk=20;
$mystop=$MONTAGE.price;
$pricetostop=$buyprice-$mystop;
$target1=2*$pricetostop+Ask;
$target2=3*$pricetostop+Ask;
$amount=$risk/$pricetostop;
$MONTAGE.Share=$amount;
$MONTAGE.ROUTE="LIMIT";
$MONTAGE.Price=Round($buyprice,2);
$MONTAGE.TIF=DAY+;
$MONTAGE.BUY;
// wait for fill
wait(2000);
// calculate the split positions
$amount=round($montage.pos/2,0);
$rest=$montage.pos-$amount;
// higher target 2
$MONTAGE.ROUTE="STOP";
$MONTAGE.StopType="RANGEMKT";
$MONTAGE.StopPrice=$mystop;
$MONTAGE.Lowprice=$mystop;
$MONTAGE.Highprice=$target2;
$MONTAGE.Share=$rest;
$MONTAGE.TIF=DAY+;
$MONTAGE.SELL;
// lower target 1
$MONTAGE.ROUTE="STOP";
$MONTAGE.StopType="RANGEMKT";
$MONTAGE.StopPrice=$mystop;
$MONTAGE.Lowprice=$mystop;
$MONTAGE.Highprice=$target1;
$MONTAGE.Share=$amount;
$MONTAGE.TIF=DAY+;
$MONTAGE.SELL;
15. I would like to have an auto-liquidation function so that when my combined realized and unrealized P & L exceeds my daily loss limit, all open positions are closed. Generally I will only have one open position at a time. Note: I trade with Interactive Brokers integrated with Das Trader Pro. While they do have this functionality, it does not work during premarket hours which is when I do most of my trading. I am a beginner trader and I bag hold when I get emotional. Although I aim to beat this behavior in the near future, as I have already in the SIM, this would be a useful safety net.
This would be a very good feature but currently the DAS Trader Pro version does not allow us to close positions that are not in focus. (like the panic command during market open hours) Therefore, it would work only in limited scenarios.
We can read these values from the account object
From which it is easy to calculate the current Realized and Unrealized and compare it to the daily limit and call for actions.
$MYREALIZED=GetAccountObj($myaccount).realized;
$MYunREALIZED=GetAccountObj($myaccount).unrealized;
// if max loss is reached call the exit and display message
if($MYunREALIZED+$MYREALIZED<-200)
{
$montage.exechotkey("Exit");
// remove the below line if running in an timer event script
msgbox("Max Loss reached");
}
the Exit hotkey is the universal exit from this post
The code needs to be checking your realized and unrealized constantly so either every second in a timer event script or in a chart update script.
There used to be an option with alerts but i think it is not working
16. Do you think it’s worth going down the API algo trading rabbit hole with DAS?
I never did it because I do not like the idea of paying for the trading platform and paying extra for connecting to it. Also, I do not like that I would need to use different tools and language for reading the chart from DAS, doing the calculations then come back to DAS to execute. If it was free I would give it a shot but the documentation being poor and the features being limited, I do not know what I would be paying for when I can execute a prepared hotkey and do the stuff for me within the app.
17. options greeks without having to pay extra
I am sorry I never traded a single option using DAS neither I am aware of the costs associated with it. Maybe one day…
18. Graph unrealized gains on same timeframe.
This has been covered here