This may be a very simple question, but I can't seem to figure it out. I am trying to show my trade arrows on a chart after running a backtest, but they do not show up automatically based on my code. If I double click the ticker in the backtest result list, the standard red and green arrows show up. I would like them to show up based on my code.
I do have "Show Trading Arrows" as Yes in the chart parameters.
Is it because of how I have my charts set up - I am using a specific tab on my chart window. I have posted a screenshot of that, in case there is something I am doing wrong there.
Thanks for the help!
//Buy XIV if $VXV >= $VIX
//Buy VXX if $VXV < $VIX
//Set Watchlist to XIV Only
#include_once "Formulas\Norgate Data\Norgate Data Functions.afl"
// Portfolio Settings
SetOption( "InitialEquity", 75000 ); /* starting capital */
SetOption( "CommissionMode", 3 ); /* set commissions AND costs as $ per share */
SetOption( "CommissionAmount", 0.005 ); /* commissions AND cost */
SetOption("MaxOpenPositions", 1);
SetPositionSize(100, spsPercentOfEquity);
SetTradeDelays(1,1,1,1);
// Sets the other tickers to reference to test the conditions for trading
VXV = Foreign( "$VXV", "C" );
VIX = Foreign( "$VIX", "C" );
XIV = Foreign( "XIV", "C" );
VXX = Foreign( "VXX", "C" );
// Sets the Buy and Sell conditions
BuyXIV = VXV >= VIX;
SellXIV = VXV < VIX;
//BuyVXX = VXV < VIX;
//SellVXX = VXV > VIX;
// Establish the Buy and Sell rules
Buy = BuyXIV;
Buy = ExRem( BuyXIV, SellXIV ); //This removes all the trade arrows when there is no trade
BuyPrice = Open * 1.001; //This adds some slippage to factor in not getting exact open price in real world
Sell = SellXIV;
Sell = ExRem( Sell, Buy); //This removes all the trade arrows when there is no trade
SellPrice = Open * 1.001; //This adds some slippage to factor in not getting exact open price in real world
// Set the display paramaters on the chart
PlotShapes(Buy*shapeUpArrow, colorYellow, 0, BuyXIV);
PlotShapes(Sell*shapeDownArrow, colorWhite, 0, SellXIV);