I'm trying to 'prime' a program, so that once event A occurs, it then looks for event B to occur, at which point it sends a buy order. To give an example with dummy code (that matches the code logic of my script):
Code: Select all
inputs:
Price(Close);
vars:
var(0),
numentries(0);
if Price < CloseD(1) then
var = 1;
if var = 1 and Price > CloseD(1) and numentries = 0 then
buy next bar market;
if marketposition = 1 then
var = 0;
numentries = 1;
But: no buy order is sent even when the conditions are met. Thoughts?