Multi TimeFrame for Beginner

#1
Hello
I am beginner,
I try to test a formula but I have problems with TimeFrame.
My database is In5minute.

I would like to buy at the opening of the day, if this opening is greater than 2.5% above the previous day and if Input3 > 1200.
No other purchases after.
Sell at the closing of the Bar in5minute of 103000, if result greater than 2%.

It does not work.

Thanks for your help

Formula test:

SetTradeDelays( 0, 0, 0, 0 );
TimeFrameSet( inDaily );
Input1 = Ref(H,-1)*1.025;
Input2 = O;
V1_200 = Ref(MA(Volume,200),-1)*Ref(MA(Close,200),-1);
VJ0_10 = Ref(MA(Volume,10),-1)*Ref(MA(Close,10),-1);
RV1_200 = (V1_200*0.18)/100;
RVJ0_10 = (VJ0_10*0.18)/100;
VALC_1 = int(((3*RV1_200)+RVJ0_10)/4);
Input3 = VALC_1;
TimeFrameRestore();

BuyCond_1 = TimeFrameExpand(Input2, inDaily) >= TimeFrameExpand(Input1, inDaily);
BuyCond_2 = TimeFrameExpand(Input3, inDaily) > 1200;

Filter = BuyCond_1 == 1 AND BuyCond_2 == 1;

Buy = BuyCond_1;
BuyPrice = TimeFrameExpand(Input2, inDaily);

SellCond_1 = C > BuyPrice*1.02 AND Cross (TimeNum(),103000);
Sell = SellCond_1;
SellePrice = C;
 

Similar threads